Home Reference Source Test
public class | source

Point

A point with x, y, z values. It may also be referred to as a Vector.

Static Method Summary

Static Public Methods
public static

copy(point: Point): *

Returns a copy of a point.

Constructor Summary

Public Constructor
public

An x, y, z point.

Member Summary

Public Members
public

x: *

{number} X position of the point.

public

y: *

{number} Y position of the point.

public

z: *

{number} Z position of the point.

Method Summary

Public Methods
public

add(divX: number, divY: number, divZ: number): Point

Adds the point by a number(s).

public

divide(divX: number, divY: number, divZ: number): Point

Divides the point by a number.

public

length(): *

Gets the length of this point as a vector.

public

multiply(divX: number, divY: number, divZ: number): Point

Multiplies the point by a number.

public

Normalizes this vector to a unit vector.

public

set(x: number, y: number, z: number)

Sets the point to a new x, y, z.

public

subtract(divX: number, divY: number, divZ: number): Point

Subtracts the point by a number(s).

Static Public Methods

public static copy(point: Point): * source

Returns a copy of a point.

Params:

NameTypeAttributeDescription
point Point

Point to copy.

Return:

*

Public Constructors

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

An x, y, z point. Default parameters are set as 0.

Params:

NameTypeAttributeDescription
x number

X position of the point.

y number

Y position of the point.

z number

Z position of the point.

Public Members

public x: * source

{number} X position of the point.

public y: * source

{number} Y position of the point.

public z: * source

{number} Z position of the point.

Public Methods

public add(divX: number, divY: number, divZ: number): Point source

Adds the point by a number(s). The first parameter will define all x, y, z values for addition if the 2nd and 3rd are not specified.

Params:

NameTypeAttributeDescription
divX number
divY number
divZ number

Return:

Point

This point after modification.

public divide(divX: number, divY: number, divZ: number): Point source

Divides the point by a number. The first parameter will define all x, y, z values for division if the 2nd and 3rd are not specified.

Params:

NameTypeAttributeDescription
divX number
divY number
divZ number

Return:

Point

This point after modification.

public length(): * source

Gets the length of this point as a vector. sqrt(x^2 + y^2 + z^2).

Return:

*

public multiply(divX: number, divY: number, divZ: number): Point source

Multiplies the point by a number. The first parameter will define all x, y, z values for multiplication if the 2nd and 3rd are not specified.

Params:

NameTypeAttributeDescription
divX number
divY number
divZ number

Return:

Point

This point after modification.

public normalize() source

Normalizes this vector to a unit vector.

public set(x: number, y: number, z: number) source

Sets the point to a new x, y, z. Previous values are set as default parameters.

Params:

NameTypeAttributeDescription
x number

X position of the point.

y number

Y position of the point.

z number

Z position of the point.

public subtract(divX: number, divY: number, divZ: number): Point source

Subtracts the point by a number(s). The first parameter will define all x, y, z values for subtraction if the 2nd and 3rd are not specified.

Params:

NameTypeAttributeDescription
divX number
divY number
divZ number

Return:

Point

This point after modification.