Header menu logo Euclid

Pt Type

Pt is an immutable 2D point. Made up from 2 floats: X and Y.

3D Points are called 'Pnt'

Record fields

Record Field Description

X

Full Usage: X

Field type: float

Gets the X part of this 2D point.

Field type: float

Y

Full Usage: Y

Field type: float

Gets the X part of this 2D point.

Field type: float

Constructors

Constructor Description

Pt(x, y)

Full Usage: Pt(x, y)

Parameters:
    x : float
    y : float

Returns: Pt

Create a new 2D point. Made up from 2 floats: X and Y.

x : float
y : float
Returns: Pt

Instance members

Instance member Description

this.AsString

Full Usage: this.AsString

Returns: string

Format 2D point into string with nice floating point number formatting of X and Y But without full type name as in p.ToString()

Returns: string

Static members

Static member Description

f * a

Full Usage: f * a

Parameters:
    f : float
    a : Pt

Returns: Pt
Modifiers: inline

Multiplies a scalar with a 2D point, also called scaling a point. Returns a new 2D point.

f : float
a : Pt
Returns: Pt

a * f

Full Usage: a * f

Parameters:
    a : Pt
    f : float

Returns: Pt
Modifiers: inline

Multiplies a 2D point with a scalar, also called scaling a point. Returns a new 2D point.

a : Pt
f : float
Returns: Pt

a + b

Full Usage: a + b

Parameters:
Returns: Pt
Modifiers: inline

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

a : Pt
b : Pt
Returns: Pt

p + v

Full Usage: p + v

Parameters:
Returns: Pt
Modifiers: inline

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

p : Pt
v : UnitVc
Returns: Pt

p + v

Full Usage: p + v

Parameters:
Returns: Pt
Modifiers: inline

Add two 2D points together. Returns a new 2D point.

p : Pt
v : Vc
Returns: Pt

a - b

Full Usage: a - b

Parameters:
Returns: Pt
Modifiers: inline

Subtract a vector from a 2D point. Returns a new 2D point.

a : Pt
b : UnitVc
Returns: Pt

a - b

Full Usage: a - b

Parameters:
Returns: Pt
Modifiers: inline

Subtract a unit-vector from a 2D point. Returns a new 2D point.

a : Pt
b : Vc
Returns: Pt

a - b

Full Usage: a - b

Parameters:
Returns: Vc
Modifiers: inline

Subtract one 2D point from another. 'a-b' returns a new 2D vector from b to a.

a : Pt
b : Pt
Returns: Vc

p / f

Full Usage: p / f

Parameters:
    p : Pt
    f : float

Returns: Pt
Modifiers: inline

Divides a 2D vector by a scalar, also be called dividing/scaling a vector. Returns a new 2D vector.

p : Pt
f : float
Returns: Pt

Pt.DivideByInt(pt, i)

Full Usage: Pt.DivideByInt(pt, i)

Parameters:
    pt : Pt
    i : int

Returns: Pt

Divides the 3D point by an integer. (This member is needed by Array.average and similar functions)

pt : Pt
i : int
Returns: Pt

Pt.Origin

Full Usage: Pt.Origin

Returns: Pt
Modifiers: inline

Same as Pt.Zero.

Returns: Pt

Pt.Zero

Full Usage: Pt.Zero

Returns: Pt
Modifiers: inline

Same as Pt.Origin.

Returns: Pt

Type something to start searching.