Point3

class Communicator.Point3()

Constructors

Properties


Constructors

constructor

Communicator.Point3.constructor(x, y, z)

Creates a new point object.

Arguments
  • x (number()) –

  • y (number()) –

  • z (number()) –

Return type

Communicator.Point3

Properties

Communicator.Point3.x
Communicator.Point3.y
Communicator.Point3.z

Methods

add

Communicator.Point3.add(p1, p2)

Adds two points.

Arguments
Return type

Communicator.Point3

Returns

Sum of p1 and p2.

assign

Communicator.Point3.assign(point)

Sets this point equal to another point.

Arguments
Return type

Communicator.Point3

Returns

This point object.

copy

Communicator.Point3.copy()

Creates a copy of this point.

Return type

Communicator.Point3

Returns

Copy of this point object.

equals

Communicator.Point3.equals(other)

Strictly compares this point with another.

Arguments
Return type

boolean

Returns

True if the values of this point equal those of the other.

equalsWithTolerance

Communicator.Point3.equalsWithTolerance(other, tolerance)

Compares this point with another using a tolerance.

Arguments
  • other (Communicator.Point3()) – Point to compare with.

  • tolerance (number()) – Tolerance to be used in the comparison.

Return type

boolean

Returns

True if the values of this point equal those of the other.

forJson

Communicator.Point3.forJson()

Note

forJson is deprecated: Use toJson instead.

Return type

Object

fromArray

Communicator.Point3.fromArray(arr)

Sets this point from an array.

Arguments
  • arr ([number]()) – Array to assign from.

Return type

Communicator.Point3

Returns

This point object.

isAxis

Communicator.Point3.isAxis()

Returns a boolean value indicating if this vector lies on a major axis.

Return type

boolean

length

Communicator.Point3.length()

Returns the length of this vector.

Return type

number

Returns

Vector length.

negate

Communicator.Point3.negate()

Negates the point.

Return type

Communicator.Point3

Returns

This object.

normalize

Communicator.Point3.normalize()

Normalizes the vector.

Return type

Communicator.Point3

Returns

This object.

scale

Communicator.Point3.scale(p, k)

Scale a point by a constant factor

Arguments
Return type

Communicator.Point3

Returns

Copy of p scaled by a constant factor

set

Communicator.Point3.set(x, y, z)

Sets the values of this point.

Arguments
  • x (number()) – X value to set.

  • y (number()) – Y value to set.

  • z (number()) – Z value to set.

Return type

Communicator.Point3

Returns

This point object.

squaredLength

Communicator.Point3.squaredLength()

Returns the squared length of this vector.

Return type

number

Returns

Vector squared length.

subtract

Communicator.Point3.subtract(p1, p2)

Subtract two points.

Arguments
Return type

Communicator.Point3

Returns

Difference of p1 and p2.

toArray

Communicator.Point3.toArray(arr)

Sets an array from this point.

Arguments
  • arr ([number]()) – Array to assign.

Return type

void

toJson

Communicator.Point3.toJson()

Creates an object ready for JSON serialization.

Return type

Object

Returns

The prepared object.

construct

Communicator.Point3.construct(obj)

Note

construct is deprecated: Use fromJson instead.

Arguments
  • obj (any()) –

Return type

Communicator.Point3

createFromArray

Communicator.Point3.createFromArray(arr)

Creates a point from an array of numbers

Arguments
  • arr ([number]()) –

Return type

Communicator.Point3

Returns

new point set from array elements

cross

Communicator.Point3.cross(p1, p2)

Calculate cross product.

Arguments
Return type

Communicator.Point3

Returns

Cross product of p1 and p2.

distance

Communicator.Point3.distance(p1, p2)

Calculate distance between two points

Arguments
Return type

number

Returns

Distance between p1 and p2

dot

Communicator.Point3.dot(p1, p2)

Calculate dot product.

Arguments
Return type

number

Returns

Dot product of p1 and p2.

fromJson

Communicator.Point3.fromJson(objData)

Creates a new [[Point3]] from an object given by toJson

Arguments
  • objData (any()) – An object given by toJson

Return type

Communicator.Point3

Returns

The prepared object.

zero

Communicator.Point3.zero()

Creates a new Point initialized to (0,0,0).

Return type

Communicator.Point3

Returns

New point with all elements set to 0.