Logo Euclid

AutoOpenPt Module

When Euclid is opened this module will be auto-opened. It only contains extension members for type Pt.

Type extensions

Type extension Description

this.Angle2PiTo

Full Usage: this.Angle2PiTo

Parameters:
Returns: float
Modifiers: inline

Returns the angle in Radians from this point to another point. 0.0 = Xaxis, going Counter-Clockwise till two Pi. Fails if the two points are coincident or too close together.

Extended Type: Pt

o : Pt
Returns: float

this.Angle360To

Full Usage: this.Angle360To

Parameters:
Returns: float
Modifiers: inline

Returns the angle in Degrees from this point to another point. 0.0 = Xaxis, going Counter-Clockwise till 360. Fails if the two points are coincident or too close together.

Extended Type: Pt

o : Pt
Returns: float

this.AsPnt

Full Usage: this.AsPnt

Parameters:
    () : unit

Returns: Pnt
Modifiers: inline

Returns the 2D point as 3D point. Using 0.0 for Z. Use the member pt.WithZ to set Z to a different value.

Extended Type: Pt

() : unit
Returns: Pnt

this.AsVc

Full Usage: this.AsVc

Parameters:
    () : unit

Returns: Vc
Modifiers: inline

Returns the 2D point as 2D vector.

Extended Type: Pt

() : unit
Returns: Vc

this.AsVec

Full Usage: this.AsVec

Parameters:
    () : unit

Returns: Vec
Modifiers: inline

Returns the 2D point as 3D vector. Using 0.0 for Z.

Extended Type: Pt

() : unit
Returns: Vec

this.ClosestPointOnLine

Full Usage: this.ClosestPointOnLine

Parameters:
Returns: Pt
Modifiers: inline

Returns the closest point on a finite line segment to test point. The line segment is given as a Line2D `ln`. Fails if the line is degenerate (zero-length).

Extended Type: Pt

ln : Line2D
Returns: Pt

this.DirectionDiamondTo

Full Usage: this.DirectionDiamondTo

Parameters:
Returns: float
Modifiers: inline

Returns the Diamond Angle from this point to another point. Calculates the proportion of X to Y component. It is always positive and in the range of 0.0 to 4.0 (for 360 Degrees) 0.0 = Xaxis, going Counter-Clockwise. It is the fastest angle calculation since it does not involve Cosine or ArcTangent functions. Fails if the two points are coincident or too close together.

Extended Type: Pt

o : Pt
Returns: float

this.DistanceFromOrigin

Full Usage: this.DistanceFromOrigin

Parameters:
    () : unit

Returns: float
Modifiers: inline

Returns the distance from Origin (0, 0)

Extended Type: Pt

() : unit
Returns: float

this.DistanceTo

Full Usage: this.DistanceTo

Parameters:
Returns: float
Modifiers: inline

Returns the distance between two 2D points.

Extended Type: Pt

b : Pt
Returns: float

this.DistanceToLine

Full Usage: this.DistanceToLine

Parameters:
Returns: float
Modifiers: inline

Returns the distance between point and finite line segment. The line segment is given as a Line2D `ln`.

Extended Type: Pt

ln : Line2D
Returns: float

this.DistanceToXY

Full Usage: this.DistanceToXY

Parameters:
    x : float
    y : float

Returns: float
Modifiers: inline

Returns the distance between a 2D point and given x, y coordinates.

Extended Type: Pt

x : float
y : float
Returns: float

this.IsAlmostOrigin

Full Usage: this.IsAlmostOrigin

Parameters:
    tol : float

Returns: bool
Modifiers: inline

Returns a boolean indicating whether the absolute value of X and Y is each less than the given tolerance.

Extended Type: Pt

tol : float
Returns: bool

this.IsInValid

Full Usage: this.IsInValid

Parameters:
    () : unit

Returns: bool
Modifiers: inline

Returns a boolean indicating whether X or Y is NaN or Infinity.

Extended Type: Pt

() : unit
Returns: bool

this.IsNotOrigin

Full Usage: this.IsNotOrigin

Parameters:
    () : unit

Returns: bool
Modifiers: inline

Returns a boolean indicating if any of X and Y is not exactly 0.0.

Extended Type: Pt

() : unit
Returns: bool

this.IsOrigin

Full Usage: this.IsOrigin

Parameters:
    () : unit

Returns: bool
Modifiers: inline

Returns a boolean indicating whether X and Y are exactly 0.0.

Extended Type: Pt

() : unit
Returns: bool

this.IsValid

Full Usage: this.IsValid

Parameters:
    () : unit

Returns: bool
Modifiers: inline

Returns a boolean indicating whether X and Y are both valid (not NaN or Infinity).

Extended Type: Pt

() : unit
Returns: bool

this.Rotate

Full Usage: this.Rotate

Parameters:
    angDegree : float

Returns: Pt
Modifiers: inline

Rotate the 2D point in Degrees. Counter Clockwise.

For better performance precompute the Rotation2D struct and rotate with this.RotateBy(rotation2D).

Extended Type: Pt

angDegree : float
Returns: Pt

this.Rotate90CCW

Full Usage: this.Rotate90CCW

Parameters:
    () : unit

Returns: Pt
Modifiers: inline

90 Degree rotation Counter-Clockwise.

Extended Type: Pt

() : unit
Returns: Pt

this.Rotate90CW

Full Usage: this.Rotate90CW

Parameters:
    () : unit

Returns: Pt
Modifiers: inline

90 Degree rotation clockwise.

Extended Type: Pt

() : unit
Returns: Pt

this.RotateBy

Full Usage: this.RotateBy

Parameters:
Returns: Pt
Modifiers: inline

Rotate a 2D point Counter Clockwise by a 2D Rotation (that has cos and sin precomputed)

Extended Type: Pt

r : Rotation2D
Returns: Pt

this.RotateByQuarterCircle

Full Usage: this.RotateByQuarterCircle

Parameters:
    numberOfQuarters : int

Returns: Pt
Modifiers: inline

Rotates the 2D point by a given number of quarter-circles (i.e. multiples of 90 degrees or Pi/2 radians). A positive number rotates counter-clockwise, a negative number rotates clockwise. The length of the vector is preserved.

Extended Type: Pt

numberOfQuarters : int
Returns: Pt

this.RotateRadians

Full Usage: this.RotateRadians

Parameters:
    angRadians : float

Returns: Pt
Modifiers: inline

Rotate the 2D point in Radians. Counter Clockwise.

For better performance precompute the Rotation2D struct and rotate with this.RotateBy(rotation2D).

Extended Type: Pt

angRadians : float
Returns: Pt

this.SqDistanceFromOrigin

Full Usage: this.SqDistanceFromOrigin

Parameters:
    () : unit

Returns: float
Modifiers: inline

Returns the squared distance from Origin (0, 0)

Extended Type: Pt

() : unit
Returns: float

this.SqDistanceTo

Full Usage: this.SqDistanceTo

Parameters:
Returns: float
Modifiers: inline

Returns the squared distance between two 2D points. This operation is slightly faster than the distance function, and sufficient for many algorithms like finding closest points.

Extended Type: Pt

b : Pt
Returns: float

this.SqDistanceToLine

Full Usage: this.SqDistanceToLine

Parameters:
Returns: float
Modifiers: inline

Returns the squared distance between point and finite line segment. The line segment is given as a Line2D `ln`.

Extended Type: Pt

ln : Line2D
Returns: float

this.SqDistanceToXY

Full Usage: this.SqDistanceToXY

Parameters:
    x : float
    y : float

Returns: float
Modifiers: inline

Returns the squared distance between a 2D point and given x, y coordinates.

Extended Type: Pt

x : float
y : float
Returns: float

this.WithDistanceFromOrigin

Full Usage: this.WithDistanceFromOrigin

Parameters:
    l : float

Returns: Pt
Modifiers: inline

Returns new 2D point with given distance from Origin by scaling it up or down.

Extended Type: Pt

l : float
Returns: Pt

this.WithX

Full Usage: this.WithX

Parameters:
    x : float

Returns: Pt
Modifiers: inline

Returns new 2D point with new X coordinate, Y stays the same.

Extended Type: Pt

x : float
Returns: Pt

this.WithY

Full Usage: this.WithY

Parameters:
    y : float

Returns: Pt
Modifiers: inline

Returns new 2D point with new Y coordinate, X stays the same.

Extended Type: Pt

y : float
Returns: Pt

this.WithZ

Full Usage: this.WithZ

Parameters:
    z : float

Returns: Pnt
Modifiers: inline

Returns new 3D point with Z coordinate, X and Y stay the same. If you want Z to be 0.0 you can use pt.AsPnt too.

Extended Type: Pt

z : float
Returns: Pnt

Pt.add a b

Full Usage: Pt.add a b

Parameters:
Returns: Pt
Modifiers: inline

Adds two 2D points. Returns a new 2D point.

Extended Type: Pt

a : Pt
b : Pt
Returns: Pt

Pt.addVc v a

Full Usage: Pt.addVc v a

Parameters:
Returns: Pt
Modifiers: inline

Add a 2D point to a 2D vector. Returns a new 2D point.

Extended Type: Pt

v : Vc
a : Pt
Returns: Pt

Pt.angle180Pts (ptPrev, ptThis, ptNext)

Full Usage: Pt.angle180Pts (ptPrev, ptThis, ptNext)

Parameters:
    ptPrev : Pt
    ptThis : Pt
    ptNext : Pt

Returns: float
Modifiers: inline

Returns angle between three 2D Points in Degrees. Range 0.0 to 180

Extended Type: Pt

ptPrev : Pt
ptThis : Pt
ptNext : Pt
Returns: float

Pt.angle2PiTo (fromPt, toPt)

Full Usage: Pt.angle2PiTo (fromPt, toPt)

Parameters:
    fromPt : Pt
    toPt : Pt

Returns: float
Modifiers: inline

Returns the angle in Radians from 'fromPt' to 'toPt'. 0.0 = Xaxis, going Counter-Clockwise till two Pi. Fails if the two points are coincident or too close together.

Extended Type: Pt

fromPt : Pt
toPt : Pt
Returns: float

Pt.angle360To (fromPt, toPt)

Full Usage: Pt.angle360To (fromPt, toPt)

Parameters:
    fromPt : Pt
    toPt : Pt

Returns: float
Modifiers: inline

Returns the angle in Degrees from 'fromPt' to 'toPt'. 0.0 = Xaxis, going Counter-Clockwise till 360. Fails if the two points are coincident or too close together.

Extended Type: Pt

fromPt : Pt
toPt : Pt
Returns: float

Pt.angleInCorner (prevPt, thisPt, nextPt)

Full Usage: Pt.angleInCorner (prevPt, thisPt, nextPt)

Parameters:
    prevPt : Pt
    thisPt : Pt
    nextPt : Pt

Returns: float

Returns angle in Degrees at mid point (thisPt).

Extended Type: Pt

prevPt : Pt
thisPt : Pt
nextPt : Pt
Returns: float

Pt.anglePiPts (ptPrev, ptThis, ptNext)

Full Usage: Pt.anglePiPts (ptPrev, ptThis, ptNext)

Parameters:
    ptPrev : Pt
    ptThis : Pt
    ptNext : Pt

Returns: float
Modifiers: inline

Returns angle between three 2D Points in Radians. Range 0.0 to Pi.

Extended Type: Pt

ptPrev : Pt
ptThis : Pt
ptNext : Pt
Returns: float

Pt.asPnt pt

Full Usage: Pt.asPnt pt

Parameters:
Returns: Pnt
Modifiers: inline

Returns the 2D point as 3D point. Using 0.0 for Z. Use the member pt.WithZ to set Z to a different value.

Extended Type: Pt

pt : Pt
Returns: Pnt

Pt.asVc pt

Full Usage: Pt.asVc pt

Parameters:
Returns: Vc
Modifiers: inline

Returns the 2D point as 2D vector.

Extended Type: Pt

pt : Pt
Returns: Vc

Pt.asVec pt

Full Usage: Pt.asVec pt

Parameters:
Returns: Vec
Modifiers: inline

Returns the 2D point as 3D vector. Using 0.0 for Z.

Extended Type: Pt

pt : Pt
Returns: Vec

Pt.bisector (ptPrev, ptThis, ptNext)

Full Usage: Pt.bisector (ptPrev, ptThis, ptNext)

Parameters:
    ptPrev : Pt
    ptThis : Pt
    ptNext : Pt

Returns: Vc
Modifiers: inline

Returns a (not unitized) bisector vector in the middle direction from ptThis. Code : (ptPrev-ptThis).Unitized + (ptNext-ptThis).Unitized ptPrev * ptThis * ptNext -> bisector vector

Extended Type: Pt

ptPrev : Pt
ptThis : Pt
ptNext : Pt
Returns: Vc

Pt.closestOfTwo pt1 pt2 referencePoint

Full Usage: Pt.closestOfTwo pt1 pt2 referencePoint

Parameters:
    pt1 : Pt
    pt2 : Pt
    referencePoint : Pt

Returns: Pt

Returns the closer point of the two points to the reference given point. When both points are equally close, the first point is returned.

Extended Type: Pt

pt1 : Pt
pt2 : Pt
referencePoint : Pt
Returns: Pt

Pt.closestPointOnLine ln testPt

Full Usage: Pt.closestPointOnLine ln testPt

Parameters:
Returns: Pt
Modifiers: inline

Returns the closest point on a finite line segment to test point. The line segment is given as a Line2D `ln`. Fails if the line is degenerate (zero-length).

Extended Type: Pt

ln : Line2D
testPt : Pt
Returns: Pt

Pt.createFromMembersXY pt

Full Usage: Pt.createFromMembersXY pt

Parameters:
    pt : ^T

Returns: Pt
Modifiers: inline
Type parameters: ^T, ^a, ^b (requires (member get_X : ^T -> ^a) and (member get_Y : ^T -> ^b) and (static member op_Explicit : ^a -> Microsoft.FSharp.Core.float) and (static member op_Explicit : ^b -> Microsoft.FSharp.Core.float))

Accepts any type that has X and Y (UPPERCASE) members that can be converted to float values. Internally this is not using reflection at runtime but F# Statically Resolved Type Parameters at compile time.

Extended Type: Pt

pt : ^T
Returns: Pt

Pt.createFromMembersxy pt

Full Usage: Pt.createFromMembersxy pt

Parameters:
    pt : ^T

Returns: Pt
Modifiers: inline
Type parameters: ^T, ^a, ^b (requires (member get_x : ^T -> ^a) and (member get_y : ^T -> ^b) and (static member op_Explicit : ^a -> Microsoft.FSharp.Core.float) and (static member op_Explicit : ^b -> Microsoft.FSharp.Core.float))

Accepts any type that has x and y (lowercase) members that can be converted to float values. Internally this is not using reflection at runtime but F# Statically Resolved Type Parameters at compile time.

Extended Type: Pt

pt : ^T
Returns: Pt

Pt.createFromPnt p

Full Usage: Pt.createFromPnt p

Parameters:
Returns: Pt
Modifiers: inline

Create 2D point from 3D point. Ignoring Z component.

Extended Type: Pt

p : Pnt
Returns: Pt

Pt.createFromUnitVc v

Full Usage: Pt.createFromUnitVc v

Parameters:
Returns: Pt
Modifiers: inline

Create 2D point from 2D unit-vector.

Extended Type: Pt

v : UnitVc
Returns: Pt

Pt.createFromVc v

Full Usage: Pt.createFromVc v

Parameters:
Returns: Pt
Modifiers: inline

Create 2D point from 2D vector.

Extended Type: Pt

v : Vc
Returns: Pt

Pt.directionDiamondTo o p

Full Usage: Pt.directionDiamondTo o p

Parameters:
Returns: float
Modifiers: inline

Returns the Diamond Angle from this point to another point. Calculates the proportion of X to Y component. It is always positive and in the range of 0.0 to 4.0 (for 360 Degrees) 0.0 = Xaxis, going Counter-Clockwise. It is the fastest angle calculation since it does not involve Cosine or ArcTangent functions. Fails if the two points are coincident or too close together.

Extended Type: Pt

o : Pt
p : Pt
Returns: float

Pt.dist b p

Full Usage: Pt.dist b p

Parameters:
Returns: float
Modifiers: inline

Returns the distance between two 2D points. Same as Pt.distanceTo.

Extended Type: Pt

b : Pt
p : Pt
Returns: float

Pt.distPt (fromPt, dirPt, distance)

Full Usage: Pt.distPt (fromPt, dirPt, distance)

Parameters:
    fromPt : Pt
    dirPt : Pt
    distance : float

Returns: Pt
Modifiers: inline

Returns a point that is at a given distance from a 2D point in the direction of another point.

Extended Type: Pt

fromPt : Pt
dirPt : Pt
distance : float
Returns: Pt

Pt.distanceFromOrigin pt

Full Usage: Pt.distanceFromOrigin pt

Parameters:
Returns: float
Modifiers: inline

Returns the distance from Origin (0, 0)

Extended Type: Pt

pt : Pt
Returns: float

Pt.distanceTo b p

Full Usage: Pt.distanceTo b p

Parameters:
Returns: float
Modifiers: inline

Returns the distance between two 2D points. Same as Pt.dist

Extended Type: Pt

b : Pt
p : Pt
Returns: float

Pt.distanceToLine ln testPt

Full Usage: Pt.distanceToLine ln testPt

Parameters:
Returns: float
Modifiers: inline

Returns the distance between point and finite line segment. The line segment is given as a Line2D `ln`.

Extended Type: Pt

ln : Line2D
testPt : Pt
Returns: float

Pt.distanceToXY (x, y) p

Full Usage: Pt.distanceToXY (x, y) p

Parameters:
    x : float
    y : float
    p : Pt

Returns: float
Modifiers: inline

Returns the distance between a 2D point and given x, y coordinates.

Extended Type: Pt

x : float
y : float
p : Pt
Returns: float

Pt.divPt (fromPt, toPt, rel)

Full Usage: Pt.divPt (fromPt, toPt, rel)

Parameters:
    fromPt : Pt
    toPt : Pt
    rel : float

Returns: Pt
Modifiers: inline

Linearly interpolates between two 2D points. e.g. rel=0.5 will return the middle point, rel=1.0 the endPoint, rel=3.0 a point three times the distance beyond the end point. Same as Pt.lerp.

Extended Type: Pt

fromPt : Pt
toPt : Pt
rel : float
Returns: Pt

Pt.equals tol a b

Full Usage: Pt.equals tol a b

Parameters:
    tol : float
    a : Pt
    b : Pt

Returns: bool
Modifiers: inline

Checks if two 2D points are equal within tolerance. Use a tolerance of 0.0 to check for an exact match.

Extended Type: Pt

tol : float
a : Pt
b : Pt
Returns: bool

Pt.getX pt

Full Usage: Pt.getX pt

Parameters:
Returns: float
Modifiers: inline

Gets the X value of 2D point.

Extended Type: Pt

pt : Pt
Returns: float

Pt.getY pt

Full Usage: Pt.getY pt

Parameters:
Returns: float
Modifiers: inline

Gets the Y value of 2D point.

Extended Type: Pt

pt : Pt
Returns: float

Pt.isAlmostOrigin tol pt

Full Usage: Pt.isAlmostOrigin tol pt

Parameters:
    tol : float
    pt : Pt

Returns: bool
Modifiers: inline

Returns a boolean indicating whether the absolute value of X and Y is each less than the given tolerance.

Extended Type: Pt

tol : float
pt : Pt
Returns: bool

Pt.isInValid pt

Full Usage: Pt.isInValid pt

Parameters:
Returns: bool
Modifiers: inline

Returns a boolean indicating whether X or Y is NaN or Infinity.

Extended Type: Pt

pt : Pt
Returns: bool

Pt.isNotOrigin pt

Full Usage: Pt.isNotOrigin pt

Parameters:
Returns: bool
Modifiers: inline

Returns a boolean indicating if any of X and Y is not exactly 0.0.

Extended Type: Pt

pt : Pt
Returns: bool

Pt.isOrigin pt

Full Usage: Pt.isOrigin pt

Parameters:
Returns: bool
Modifiers: inline

Returns a boolean indicating whether X and Y are exactly 0.0.

Extended Type: Pt

pt : Pt
Returns: bool

Pt.isValid pt

Full Usage: Pt.isValid pt

Parameters:
Returns: bool
Modifiers: inline

Returns a boolean indicating whether X and Y are both valid (not NaN or Infinity).

Extended Type: Pt

pt : Pt
Returns: bool

Pt.lerp (fromPt, toPt, rel)

Full Usage: Pt.lerp (fromPt, toPt, rel)

Parameters:
    fromPt : Pt
    toPt : Pt
    rel : float

Returns: Pt
Modifiers: inline

Linearly interpolates between two 2D points. e.g. rel=0.5 will return the middle point, rel=1.0 the endPoint, rel=3.0 a point three times the distance beyond the end point. Same as Pt.divPt.

Extended Type: Pt

fromPt : Pt
toPt : Pt
rel : float
Returns: Pt

Pt.midPt a b

Full Usage: Pt.midPt a b

Parameters:
Returns: Pt
Modifiers: inline

Returns the midpoint of two 2D points.

Extended Type: Pt

a : Pt
b : Pt
Returns: Pt

Pt.move shift pt

Full Usage: Pt.move shift pt

Parameters:
    shift : Vc
    pt : Pt

Returns: Pt
Modifiers: inline

Move a 2D point by a vector. Same as Pt.translate.

Extended Type: Pt

shift : Vc
pt : Pt
Returns: Pt

Pt.moveX x pt

Full Usage: Pt.moveX x pt

Parameters:
    x : float
    pt : Pt

Returns: Pt
Modifiers: inline

Add a float to X component of a 2D point. Returns a new 2D point.

Extended Type: Pt

x : float
pt : Pt
Returns: Pt

Pt.moveY y pt

Full Usage: Pt.moveY y pt

Parameters:
    y : float
    pt : Pt

Returns: Pt
Modifiers: inline

Add a float to Y component of a 2D point. Returns a new 2D point.

Extended Type: Pt

y : float
pt : Pt
Returns: Pt

Pt.notEquals tol a b

Full Usage: Pt.notEquals tol a b

Parameters:
    tol : float
    a : Pt
    b : Pt

Returns: bool

Check if two 2D points are not equal within a given tolerance. Use a tolerance of 0.0 to check if the two points are not exactly equal.

Extended Type: Pt

tol : float
a : Pt
b : Pt
Returns: bool

Pt.projectedParameter (fromPt, uv, testPt)

Full Usage: Pt.projectedParameter (fromPt, uv, testPt)

Parameters:
    fromPt : Pt - The origin point of the endless line.
    uv : UnitVc - The unit direction vector describing the orientation of the endless line.
    testPt : Pt - The point to be projected onto the line.

Returns: float The parameter (scalar value) along the unit vector at which the projection of testPt falls on the line.
Modifiers: inline

Projects a test point onto an endless line defined by an origin point and a unit direction vector.

Extended Type: Pt

fromPt : Pt

The origin point of the endless line.

uv : UnitVc

The unit direction vector describing the orientation of the endless line.

testPt : Pt

The point to be projected onto the line.

Returns: float

The parameter (scalar value) along the unit vector at which the projection of testPt falls on the line.

Pt.projectedParameter (fromPt, v, testPt)

Full Usage: Pt.projectedParameter (fromPt, v, testPt)

Parameters:
    fromPt : Pt - The origin point of the endless line.
    v : Vc - The direction vector of the endless line. Does not need to be unitized.
    testPt : Pt - The point to be projected onto the line.

Returns: float The parameter (scaling factor for the direction vector) at which the projection of testPt falls on the line.
Modifiers: inline

Projects a test point onto an endless line defined by an origin point and a direction vector.

Extended Type: Pt

fromPt : Pt

The origin point of the endless line.

v : Vc

The direction vector of the endless line. Does not need to be unitized.

testPt : Pt

The point to be projected onto the line.

Returns: float

The parameter (scaling factor for the direction vector) at which the projection of testPt falls on the line.

Pt.projectedParameter (fromPt, toPt, testPt)

Full Usage: Pt.projectedParameter (fromPt, toPt, testPt)

Parameters:
    fromPt : Pt - The start point defining the endless line.
    toPt : Pt - The end point defining the direction of the endless line.
    testPt : Pt - The point to be projected onto the line.

Returns: float The parameter along the line direction (fromPt to toPt) at which the projection of testPt falls. A value of 0.0 corresponds to fromPt, 1.0 corresponds to toPt.
Modifiers: inline

Projects a test point onto an endless line defined by two points.

Extended Type: Pt

fromPt : Pt

The start point defining the endless line.

toPt : Pt

The end point defining the direction of the endless line.

testPt : Pt

The point to be projected onto the line.

Returns: float

The parameter along the line direction (fromPt to toPt) at which the projection of testPt falls. A value of 0.0 corresponds to fromPt, 1.0 corresponds to toPt.

Pt.rotate angDegree vec

Full Usage: Pt.rotate angDegree vec

Parameters:
    angDegree : float
    vec : Pt

Returns: Pt
Modifiers: inline

Rotate the 2D point in Degrees. Counter Clockwise.

For better performance precompute the Rotation2D struct and rotate with this.RotateBy(rotation2D).

Extended Type: Pt

angDegree : float
vec : Pt
Returns: Pt

Pt.rotate90CCW pt

Full Usage: Pt.rotate90CCW pt

Parameters:
Returns: Pt
Modifiers: inline

90 Degree rotation Counter-Clockwise.

Extended Type: Pt

pt : Pt
Returns: Pt

Pt.rotate90CW pt

Full Usage: Pt.rotate90CW pt

Parameters:
Returns: Pt
Modifiers: inline

90 Degree rotation clockwise.

Extended Type: Pt

pt : Pt
Returns: Pt

Pt.rotateBy r p

Full Usage: Pt.rotateBy r p

Parameters:
Returns: Pt
Modifiers: inline

Rotate a 2D point Counter Clockwise by a 2D Rotation (that has cos and sin precomputed)

Extended Type: Pt

r : Rotation2D
p : Pt
Returns: Pt

Pt.rotateByQuarterCircle numberOfQuarters v

Full Usage: Pt.rotateByQuarterCircle numberOfQuarters v

Parameters:
    numberOfQuarters : int
    v : Pt

Returns: Pt

Rotates a point by a given number of quarter-circles (i.e. multiples of 90 degrees or Pi/2 radians). A positive number rotates counter-clockwise, a negative number rotates clockwise. The length of the vector is preserved.

Extended Type: Pt

numberOfQuarters : int
v : Pt
Returns: Pt

Pt.rotateRadians angRadians pt

Full Usage: Pt.rotateRadians angRadians pt

Parameters:
    angRadians : float
    pt : Pt

Returns: Pt
Modifiers: inline

Rotate the 2D point in Radians. Counter Clockwise.

For better performance precompute the Rotation2D struct and rotate with this.RotateBy(rotation2D).

Extended Type: Pt

angRadians : float
pt : Pt
Returns: Pt

Pt.rotateWithCenter cen angDegree pt

Full Usage: Pt.rotateWithCenter cen angDegree pt

Parameters:
    cen : Pt
    angDegree : float
    pt : Pt

Returns: Pt
Modifiers: inline

Rotate 2D point around a center point Counter-Clockwise. Angle given in Degrees.

Extended Type: Pt

cen : Pt
angDegree : float
pt : Pt
Returns: Pt

Pt.rotateWithCenterBy cen r pt

Full Usage: Pt.rotateWithCenterBy cen r pt

Parameters:
Returns: Pt
Modifiers: inline

Rotate the 2D point around a center 2D point. Counter Clockwise. By a 2D Rotation (that has cos and sin precomputed)

Extended Type: Pt

cen : Pt
r : Rotation2D
pt : Pt
Returns: Pt

Pt.scale f pt

Full Usage: Pt.scale f pt

Parameters:
    f : float
    pt : Pt

Returns: Pt
Modifiers: inline

Scales a 2D point by a factor. Returns a new 2D point.

Extended Type: Pt

f : float
pt : Pt
Returns: Pt

Pt.snap precision pt

Full Usage: Pt.snap precision pt

Parameters:
    precision : float
    pt : Pt

Returns: Pt
Modifiers: inline

Snaps the point's coordinates to the given precision. e.g. snap 0.1 Pt(0.123, 0.456) -> Pt(0.1, 0.5) e.g. snap 10 Pt(3 , 19) -> Pt(0 , 20) does: (Math.Round (x/precision)) * precision

Extended Type: Pt

precision : float
pt : Pt
Returns: Pt

Pt.snapIfClose snapDistance snapTo pt

Full Usage: Pt.snapIfClose snapDistance snapTo pt

Parameters:
    snapDistance : float
    snapTo : Pt
    pt : Pt

Returns: Pt
Modifiers: inline

Snaps to a point if it is within the snapDistance. otherwise returns the original point.

Extended Type: Pt

snapDistance : float
snapTo : Pt
pt : Pt
Returns: Pt

Pt.sqDist b p

Full Usage: Pt.sqDist b p

Parameters:
Returns: float
Modifiers: inline

Returns the squared distance between two 2D points. This operation is slightly faster than the distance function, and sufficient for many algorithms like finding closest points. Same as Pt.sqDistanceTo.

Extended Type: Pt

b : Pt
p : Pt
Returns: float

Pt.sqDistanceFromOrigin pt

Full Usage: Pt.sqDistanceFromOrigin pt

Parameters:
Returns: float
Modifiers: inline

Returns the squared distance from Origin (0, 0)

Extended Type: Pt

pt : Pt
Returns: float

Pt.sqDistanceTo b p

Full Usage: Pt.sqDistanceTo b p

Parameters:
Returns: float
Modifiers: inline

Returns the squared distance between two 2D points. This operation is slightly faster than the distance function, and sufficient for many algorithms like finding closest points. Same as Pt.sqDist.

Extended Type: Pt

b : Pt
p : Pt
Returns: float

Pt.sqDistanceToLine ln testPt

Full Usage: Pt.sqDistanceToLine ln testPt

Parameters:
Returns: float
Modifiers: inline

Returns the squared distance between point and finite line segment. The line segment is given as a Line2D `ln`.

Extended Type: Pt

ln : Line2D
testPt : Pt
Returns: float

Pt.sqDistanceToXY (x, y) p

Full Usage: Pt.sqDistanceToXY (x, y) p

Parameters:
    x : float
    y : float
    p : Pt

Returns: float
Modifiers: inline

Returns the squared distance between a 2D point and given x, y coordinates.

Extended Type: Pt

x : float
y : float
p : Pt
Returns: float

Pt.translate shift pt

Full Usage: Pt.translate shift pt

Parameters:
    shift : Vc
    pt : Pt

Returns: Pt
Modifiers: inline

Move a 2D point by a vector. Same as Pt.move.

Extended Type: Pt

shift : Vc
pt : Pt
Returns: Pt

Pt.withDistanceFromOrigin l pt

Full Usage: Pt.withDistanceFromOrigin l pt

Parameters:
    l : float
    pt : Pt

Returns: Pt
Modifiers: inline

Returns new 2D point with given distance from Origin by scaling it up or down.

Extended Type: Pt

l : float
pt : Pt
Returns: Pt

Pt.withX x pt

Full Usage: Pt.withX x pt

Parameters:
    x : float
    pt : Pt

Returns: Pt
Modifiers: inline

Returns new 2D point with new X coordinate, Y stays the same.

Extended Type: Pt

x : float
pt : Pt
Returns: Pt

Pt.withY y pt

Full Usage: Pt.withY y pt

Parameters:
    y : float
    pt : Pt

Returns: Pt
Modifiers: inline

Returns new 2D point with new Y coordinate, X stays the same.

Extended Type: Pt

y : float
pt : Pt
Returns: Pt

Pt.withZ z pt

Full Usage: Pt.withZ z pt

Parameters:
    z : float
    pt : Pt

Returns: Pnt
Modifiers: inline

Returns new 3D point with Z coordinate, X and Y stay the same. If you want Z to be 0.0 you can use pt.AsPnt too.

Extended Type: Pt

z : float
pt : Pt
Returns: Pnt

Type something to start searching.