الفرق بين المراجعتين ل"Ruby/Math/hypot"

من موسوعة حسوب
< Ruby‏ | Math
اذهب إلى التنقل اذهب إلى البحث
(أنشأ الصفحة ب'<noinclude>{{DISPLAYTITLE: التابع <code>hypot‎</code> الخاص بالصنف <code>Math</code> في روبي}}</noinclude> تصنيف: Ruby تصنيف:...')
 
سطر 3: سطر 3:
 
[[تصنيف: Ruby Method]]
 
[[تصنيف: Ruby Method]]
 
[[تصنيف: Ruby Math]]
 
[[تصنيف: Ruby Math]]
يعيد التابع <code>hypot</code> ناتج التعبير sqrt (x ** 2 + y ** 2) ، وتر مثلث قائم الزاوية (hypotenuse of a right-angled triangle) جانباه <code>x</code> و <code>y</code>.
+
يعيد التابع <code>hypot</code> ناتج التعبير <code>sqrt (x ** 2 + y ** 2)‎</code> ، الذي يمثل وتر المثلث قائم الزاوية (hypotenuse of a right-angled triangle) الذي جانباه <code>x</code> و <code>y</code>.
 
==البنية العامة==
 
==البنية العامة==
 
<syntaxhighlight lang="ruby">hypot(x, y) → Float‎</syntaxhighlight>
 
<syntaxhighlight lang="ruby">hypot(x, y) → Float‎</syntaxhighlight>
 
==المعاملات==
 
==المعاملات==
 
===<code>x‎</code>===
 
===<code>x‎</code>===
 +
عدد
  
 
===<code>y‎</code>===
 
===<code>y‎</code>===
  
 
+
عدد
 
==القيمة المُعادة==
 
==القيمة المُعادة==
 +
يعيد التابع <code>hypot</code> ناتج التعبير <code>sqrt (x ** 2 + y ** 2)‎</code>.
  
 
==أمثلة==
 
==أمثلة==
سطر 18: سطر 20:
 
<syntaxhighlight lang="ruby">Math.hypot(3, 4)  #=> 5.0‎</syntaxhighlight>
 
<syntaxhighlight lang="ruby">Math.hypot(3, 4)  #=> 5.0‎</syntaxhighlight>
 
==انظر أيضا==
 
==انظر أيضا==
* التابع <code>[[Ruby/Math/gamma|gamma]]</code>: يحسب ظظظ دالة غاما للعدد المعطى x.
+
* التابع <code>[[Ruby/Math/gamma|gamma]]</code>: يحسب دالة غاما للعدد المعطى x.
* التابع <code>[[Ruby/Math/ldexp|ldexp]]</code>: يعيد ظظظ ناتج التعبير <code>fraction</code> * (2 ** <code>exponent</code>).
+
* التابع <code>[[Ruby/Math/ldexp|ldexp]]</code>: يعيد ناتج التعبير <code>fraction * (2 **</code> <code>exponent)‎</code>.
  
 
==مصادر==
 
==مصادر==
 
*[http://ruby-doc.org/core-2.5.1/Math.html#method-c-hypot قسم  التابع hypot‎ في الصنف Math‎ في توثيق روبي الرسمي.]
 
*[http://ruby-doc.org/core-2.5.1/Math.html#method-c-hypot قسم  التابع hypot‎ في الصنف Math‎ في توثيق روبي الرسمي.]

مراجعة 11:15، 25 أكتوبر 2018

يعيد التابع hypot ناتج التعبير sqrt (x ** 2 + y ** 2)‎ ، الذي يمثل وتر المثلث قائم الزاوية (hypotenuse of a right-angled triangle) الذي جانباه x و y.

البنية العامة

hypot(x, y)  Float

المعاملات

x‎

عدد

y‎

عدد

القيمة المُعادة

يعيد التابع hypot ناتج التعبير sqrt (x ** 2 + y ** 2)‎.

أمثلة

مثال على استخدام التابع hypot‎:

Math.hypot(3, 4)   #=> 5.0‎

انظر أيضا

  • التابع gamma: يحسب دالة غاما للعدد المعطى x.
  • التابع ldexp: يعيد ناتج التعبير fraction * (2 ** exponent)‎.

مصادر