nokia.maps.util.Vector3D

Class Summary

This class represents a three dimensional vector.

[ For full details, see nokia.maps.util.Vector3D ]

Table 1. Property Summary
Properties

readonly  {Number} x

This property holds the x component of the vector.

readonly  {Number} y

This property holds the y component of the vector

readonly  {Number} z

This property holds the z component of the vector.

Table 2. Method Summary
Methods

add (other) : {nokia.maps.util.Vector3D}

This method creates the sum of the given vector and the vector provided by the caller.

angle (px, py, intertX, intertY) : {Number}

This method retrieves the angle of the given vector in decimal degrees to the given point within a coordinate system in which the highest (positive) values are in the top right.

divide (other) : {nokia.maps.util.Vector3D}

This method creates vector that represents the quotient obtained by dividing the given vector by the one supplied by the caller.

dot (other) : {number}

This method creates the dot product of the given vector and the one provided by the caller.

magnitude () : {number}

This method calculates the length of the given vector.

multiply (other) : {nokia.maps.util.Vector3D}

This method creates a vector that represents the product of the given vector and the one provided by the caller.

normal (other) : {nokia.maps.util.Vector3D}

This method creates the normal vector of the plane between the given vector and the one provided by the caller.

normalize () : {nokia.maps.util.Vector3D}

This method creates normalized representation of the given vector.

subtract (other) : {nokia.maps.util.Vector3D}

This method creates a vector that represents the difference between the given vector and the vector supplied by the caller.

Class Description

This class represents a three dimensional vector.

Property Details

readonly  {Number} x

This property holds the x component of the vector.

readonly  {Number} y

This property holds the y component of the vector

readonly  {Number} z

This property holds the z component of the vector.

Method Details

add(other) : {nokia.maps.util.Vector3D}

This method creates the sum of the given vector and the vector provided by the caller.

Parameters:
 
other

type: {nokia.maps.util.Vector3D}

The vector to be added

Returns:
{nokia.maps.util.Vector3D} A vector representing the sum of the given vector and the vector supplied by the caller

angle(px, py, intertX, intertY) : {Number}

This method retrieves the angle of the given vector in decimal degrees to the given point within a coordinate system in which the highest (positive) values are in the top right.

For screen coordinates, the y-axis must be inverted. For a normalized vector, the method can be called without parameters to return its normalized angle.

Parameters:
 
px

type: {Number}

[optional] 

The x-coordinate of the point to which the angle is to be calculated; if not provided zero is used

py

type: {Number}

[optional] 

The y-coordinate of the point to which the angle is to be calculated; if not provided zero is used

intertX

type: {Boolean}

[optional] 

If provided and true, the x-axis is inverted, therefore the coordinates are increasing to the left and decreasing to the right

intertY

type: {Boolean}

[optional] 

If provided and true, the y-axis is inverted, therefore the coordinates are increasing to the bottom and decreasing to the top

Returns:
{Number} The angle of this vector in degrees, relative to the given coordinate

divide(other) : {nokia.maps.util.Vector3D}

This method creates vector that represents the quotient obtained by dividing the given vector by the one supplied by the caller.

Parameters:
 
other

type: {nokia.maps.util.Vector3D}

The vector by which divide the given vector

Returns:
{nokia.maps.util.Vector3D} A vector representing a quotient of the division of the given vector by the one supplied by the caller

dot(other) : {number}

This method creates the dot product of the given vector and the one provided by the caller.

Parameters:
 
other

type: {nokia.maps.util.Vector3D}

The vector with which the given vector is to be dot-multiplied

Returns:
{number} The dot product of the two vectors

magnitude() : {number}

This method calculates the length of the given vector.

Returns:
{number} The length of this vector

multiply(other) : {nokia.maps.util.Vector3D}

This method creates a vector that represents the product of the given vector and the one provided by the caller.

Parameters:
 
other

type: {nokia.maps.util.Vector3D}

The vector to be multiplied

Returns:
{nokia.maps.util.Vector3D} A vector resulting from the multiplication of the given vector by the one supplied by the caller

normal(other) : {nokia.maps.util.Vector3D}

This method creates the normal vector of the plane between the given vector and the one provided by the caller.

Parameters:
 
other

type: {nokia.maps.util.Vector3D}

The vector provided by the caller

Returns:
{nokia.maps.util.Vector3D} The normal vector of the plane between the given vector and that provided by the caller

normalize() : {nokia.maps.util.Vector3D}

This method creates normalized representation of the given vector.

Returns:
{nokia.maps.util.Vector3D} The normalized representation (length = 1) of th vector

subtract(other) : {nokia.maps.util.Vector3D}

This method creates a vector that represents the difference between the given vector and the vector supplied by the caller.

Parameters:
 
other

type: {nokia.maps.util.Vector3D}

The vector to be subtracted from the given vector

Returns:
{nokia.maps.util.Vector3D} A vector resulting from the subtraction