Vec2_d.kl

Types

Vec2_d (struct)

The Vec2_d type represents a vector with 2 components. The Vec2_d is also used as the row type for the Mat22.

参考

Vec3, Vec4

/*
** Example: Vec2_d
*/

Vec2_d v(0.0, 0.0);

Members

Float64 x  
Float64 y  

Methods

  Vec2_d ( in Float64 value )
  Vec2_d ( in Float64 x, in Float64 y )
  Vec2_d ( in Vec2_d other )
  Vec2_d ()
Vec2_d add ? ( in Vec2_d other )
Boolean almostEqual ? ( in Vec2_d other )
Boolean almostEqual ? ( in Vec2_d other, in Float64 precision )
Float64 angleTo ? ( in Vec2_d other )
Vec2_d clamp ? ( in Vec2_d min, in Vec2_d max )
Vec2_d clone ? ()
Float64 component ? ( in Size i )
Float64 cross ? ( in Vec2_d other )
Float64 distanceTo ? ( in Vec2_d other )
Float64 distanceToLine ? ( in Vec2_d lineP0, in Vec2_d lineP1 )
Float64 distanceToSegment ? ( in Vec2_d segmentP0, in Vec2_d segmentP1 )
Vec2_d divide ? ( in Vec2_d other )
Vec2_d divideFloat64 ? ( in Float64 other )
Float64 dot ? ( in Vec2_d other )
Boolean equal ? ( in Vec2_d other )
  get ? ( io Float32 v<> )
  get ? ( io Float32 v<>, in UInt32 o )
  get ? ( io Float32 v[] )
  get ? ( io Float32 v[], in UInt32 o )
  get ? ( io Float64 v<> )
  get ? ( io Float64 v<>, in UInt32 o )
  get ? ( io Float64 v[] )
  get ? ( io Float64 v[], in UInt32 o )
Vec2_d getBarycentricCoords ? ( in Vec2_d a, in Vec2_d b, in Vec2_d c )
UInt32 hash ? ()
Vec2_d inverse ? ()
Boolean isInsideTriangle ? ( in Vec2_d a, in Vec2_d b, in Vec2_d c )
Boolean isInsideTriangle ? ( in Vec2_d a, in Vec2_d b, in Vec2_d c, in Float64 tolerance )
Float64 length ? ()
Float64 lengthSquared ? ()
Vec2_d linearInterpolate ? ( in Vec2_d other, in Float64 t )
Vec2_d multiply ? ( in Vec2_d other )
Vec2_d multiplyFloat64 ? ( in Float64 other )
Vec2_d negate ? ()
  normalize ! ()
Vec2_d rotate ? ( in Float64 radians )
  set ! ( in Float32 v<> )
  set ! ( in Float32 v<>, in UInt32 o )
  set ! ( in Float64 v<> )
  set ! ( in Float64 v<>, in UInt32 o )
  set ! ( in Float64 value )
  set ! ( in Float64 x, in Float64 y )
  setComponent ! ( in Size i, in Float64 v )
  setNull ! ()
Float64 setUnit ! ()
Vec2_d subtract ? ( in Vec2_d other )
Vec2_d unit ? ()
Vec2_d unit_safe ? ()
Float64 unitsAngleTo ? ( in Vec2_d other )

Operators

  - Vec2_d
Vec2_d = ( Param other )

Functions

distanceFromLineToLine

Float64 distanceFromLineToLine ( in Vec2_d l1_p0, in Vec2_d l1_p1, in Vec2_d l2_p0, in Vec2_d l2_p1, out Float64 l1_t, out Float64 l2_t )

dist3D_Line_to_Line(): Input: two 3D lines L1 and L2 Return: the shortest distance between L1 and L2

Math_min

RGBA Math_min ( in RGBA val1, in RGBA val2 )

Returns the minimum of two RGBA values

Math_max

RGBA Math_max ( in RGBA val1, in RGBA val2 )

Returns the minimum of two RGBA values

Math_clamp

Vec3_i Math_clamp ( in Vec3_i val, in Scalar minval, in Scalar maxval )

Clamps a Vec3_i value by min and max

mathRandomVec2_d

Vec2_d mathRandomVec2_d ( in Size seed, in Size index, in Float32 min, in Float32 max )

checkLineIntersection

Vec2_d checkLineIntersection ( in Vec2_d p0, in Vec2_d p1, in Vec2_d p2, in Vec2_d p3 )

Returns the intersection point of two lines formed by p0 and p1 as well as p2 and p3. Returns :ref:`Vec2_d <vec2_d>`(SCALAR_INFINITE) if there is no intersection.

checkSegmentIntersection

Vec2_d checkSegmentIntersection ( in Vec2_d p0, in Vec2_d p1, in Vec2_d p2, in Vec2_d p3 )

Returns the intersection point of two segments formed by p0 and p1 as well as p2 and p3. Returns :ref:`Vec2_d <vec2_d>`(SCALAR_INFINITE) if there is no intersection.