Click or drag to resize
sqx

SQXHypot Method

Function [float] Hypot([float] X, [float] Y)

Namespace:  sqx
Assembly:  SQX (in SQX.dll) Version: 1.0.2.6 (1.0.2.6)
Syntax
C#
public static SqlDouble Hypot(
	SqlDouble X,
	SqlDouble Y
)

Parameters

X
Type: System.Data.SqlTypesSqlDouble
[float]
Y
Type: System.Data.SqlTypesSqlDouble
[float]

Return Value

Type: SqlDouble
[float]
Remarks
Length of the hypotenuse.
Examples
SQL
-- Using Hypot to order by Nearest Neighbor
declare @V1 float = 5.5, @V2 int = 50, @V3 bigint = 250
declare @T table (ID int NOT NULL identity primary key, V1 float, V2 int, V3 bigint)
insert @T (V1,V2,V3)
select sqx.Exponential_PPF(a.Value, 0.25)
, sqx.Poisson_PPF(b.Value,55)
, sqx.Poisson_PPF(b.Value,255)
from sqx.UTable(100,1) a
inner join sqx.UTable(100,2) b on a.ID = b.ID
inner join sqx.UTable(100,3) c on a.ID = c.ID

select * from @T
order by sqx.Hypot(@V1 - V1, sqx.Hypot(@V2 - V2, @V3 - V3))
See Also