Garry's Mod Wiki

Revision Difference

Vector:Distance#512397

<function name="Distance" parent="Vector" type="classfunc">⤶ <description>⤶ Returns the pythagorean distance between the vector and the other vector.⤶ ⤶ <warning>This is a relatively expensive process since it uses the square root. It is recommended that you use <page>Vector:DistToSqr</page> whenever possible.</warning>⤶ </description>⤶ <realm>Shared</realm>⤶ <args>⤶ <arg name="otherVector" type="Vector">The vector to get the distance to.</arg>⤶ </args>⤶ <rets>⤶ <ret name="" type="number">Distance between the vectors.</ret>⤶ </rets>⤶ </function>⤶ ⤶ <example>⤶ <description>Gets the distance from A to B.</description>⤶ <code>print(Vector(0, 0, 0):Distance(Vector(2, 3, 4)))</code>⤶ <output>5.3851647377014</output>⤶ ⤶ </example>