Trig

verb.core.Trig

CLASS

Source code

Trig provides various convenient methods for trigonometry

isPointInPlane

STATIC METHOD

Source code

isPointInPlane(pt : Point, p : Plane, tol : Float) : Bool

distToSegment

STATIC METHOD

Source code

distToSegment(a : Point, b : Point, c : Point)

rayClosestPoint

STATIC METHOD

Source code

rayClosestPoint(pt : undefined, o : undefined, r : undefined)

Find the closest point on a ray

params

returns

distToRay

STATIC METHOD

Source code

distToRay(pt : undefined, o : undefined, r : undefined)

Find the distance of a point to a ray

params

returns

threePointsAreFlat

STATIC METHOD

Source code

threePointsAreFlat(p1 : undefined, p2 : undefined, p3 : undefined, tol : undefined)

Determine if three points form a straight line within a given tolerance for their 2 * squared area

      * p2
     / \
    /   \
   /     \
  /       \
 * p1 ---- * p3

The area metric is 2 * the squared norm of the cross product of two edges, requiring no square roots and no divisions

params

returns

segmentClosestPoint

STATIC METHOD

Source code

segmentClosestPoint(pt : Point, segpt0 : Point, segpt1 : Point, u0 : Float, u1 : Float)

Find the closest point on a segment

params

returns