Skip to content

tuple_hypotTupleHypotTupleHypottuple_hypottuple_hypot🔗

Short description🔗

tuple_hypotTupleHypotTupleHypottuple_hypottuple_hypot — Calculate the hypotenuse of two tuples.

Signature🔗

tuple_hypot( number T1, number T2, out number Hypot )void TupleHypot( const HTuple& T1, const HTuple& T2, HTuple* Hypot )static void HOperatorSet.TupleHypot( HTuple t1, HTuple t2, out HTuple hypot )def tuple_hypot( t1: MaybeSequence[Union[float, int]], t2: MaybeSequence[Union[float, int]] ) -> Sequence[float]

def tuple_hypot_s( t1: MaybeSequence[Union[float, int]], t2: MaybeSequence[Union[float, int]] ) -> floatHerror tuple_hypot( double T1, double T2, double* Hypot )

Herror T_tuple_hypot( const Htuple T1, const Htuple T2, Htuple* Hypot )

HTuple HTuple::TupleHypot( const HTuple& T2 ) const

HTuple HTuple.TupleHypot( HTuple t2 )

Description🔗

tuple_hypotTupleHypot computes the hypotenuse \(\sqrt{\textrm{T1}^2 + \textrm{T2}^2}\) of the input tuples. The calculation is performed without undue arithmetic overflow or underflow during the intermediate steps of the calculation. If both tuples have the same length, the hypotenuse is applied to the corresponding elements of both tuples. Otherwise, either T1t1t1 or T2t2t2 must have length 1. In this case, the hypotenuse is calculated for each element of the longer tuple with the single element of the other tuple. The result is always a floating point number. The hypotenuse of strings is not allowed.

Exception: Empty input tuples🔗

If either or both of the input tuples are empty, the operator returns an empty tuple.

HDevelop In-line Operation🔗

HDevelop provides an in-line operation for tuple_hypotTupleHypot, which can be used in an expression in the following syntax:

Hypot := hypot(T1, T2)

Execution information🔗

Execution information
  • Multithreading type: reentrant (runs in parallel with non-exclusive operators).

  • Multithreading scope: global (may be called from any thread).

  • Processed without parallelization.

Parameters🔗

T1t1t1 (input_control) number(-array) → (real / integer)HTuple (double / Hlong)HTuple (double / int / long)MaybeSequence[Union[float, int]]Htuple (double / Hlong)

Input tuple 1.

T2t2t2 (input_control) number(-array) → (real / integer)HTuple (double / Hlong)HTuple (double / int / long)MaybeSequence[Union[float, int]]Htuple (double / Hlong)

Input tuple 2.

Hypothypothypot (output_control) number(-array) → (real)HTuple (double)HTuple (double)Sequence[float]Htuple (double)

Hypotenuse of the input tuples.

Combinations with other operators🔗

Combinations

Alternatives

tuple_sqrtTupleSqrt

See also

tuple_multTupleMult, tuple_addTupleAdd

Module🔗

Foundation