Home Reference Source Repository
public class | source

CGPoint

A structure that contains a point in a two-dimensional coordinate system.

See:

Static Member Summary

Static Public Members
public static get

Static Method Summary

Static Public Methods
public static

Creates a point from a canonical dictionary representation.

Constructor Summary

Public Constructor
public

Creates a point with coordinates specified as integer values.

Member Summary

Public Members
public get

customMirror: Mirror

Mirrors are used by playgrounds and the debugger.

public get

customPlaygroundQuickLook: PlaygroundQuickLook

public get
public get
public

x: *

public

y: *

Method Summary

Public Methods
public
public

applying(t: CGAffineTransform): CGPoint

Returns the point resulting from an affine transformation of an existing point.

public
public
public

equalTo(point2: CGPoint): boolean

Returns whether two points are equal.

public
public
public
public

lerp(p: CGPoint, rate: number): CGPoint

public
public
public
public

zero(): *

Static Public Members

Static Public Methods

public static pointWithDictionaryRepresentation(dict: Map): void source

Creates a point from a canonical dictionary representation.

Params:

NameTypeAttributeDescription
dict Map

A dictionary containing x and y values for the point to create, in the format used by the dictionaryRepresentation property.

Return:

void

See:

Public Constructors

public constructor(x: number, y: number) source

Creates a point with coordinates specified as integer values.

Params:

NameTypeAttributeDescription
x number
y number

See:

Public Members

public get customMirror: Mirror source

Mirrors are used by playgrounds and the debugger.

See:

public x: * source

public y: * source

Public Methods

public add(p: CGPoint): CGPoint source

Params:

NameTypeAttributeDescription
p CGPoint

Return:

CGPoint

public applying(t: CGAffineTransform): CGPoint source

Returns the point resulting from an affine transformation of an existing point.

Params:

NameTypeAttributeDescription
t CGAffineTransform

The affine transform to apply.

Return:

CGPoint

See:

public copy(): CGPoint source

Return:

CGPoint

public dot(p: CGPoint): number source

Params:

NameTypeAttributeDescription
p CGPoint

Return:

number

public equalTo(point2: CGPoint): boolean source

Returns whether two points are equal.

Params:

NameTypeAttributeDescription
point2 CGPoint

Return:

boolean

See:

public float32Array(): Float32Array source

Return:

Float32Array

public floatArray(): number[] source

Return:

number[]

public length(): number source

Return:

number

public lerp(p: CGPoint, rate: number): CGPoint source

Params:

NameTypeAttributeDescription
p CGPoint
rate number

Return:

CGPoint

public mul(n: number): CGPoint source

Params:

NameTypeAttributeDescription
n number

Return:

CGPoint

public normalize(): CGPoint source

Return:

CGPoint

public sub(p: CGPoint): CGPoint source

Params:

NameTypeAttributeDescription
p CGPoint

Return:

CGPoint

public zero(): * source

Return:

*