ScriptModule
Vector3d Class Reference

`#include <MathInterface.h>`

Inheritance diagram for Vector3d:
[legend]
Collaboration diagram for Vector3d:
[legend]

## Public Slots

void setXYZ (const double x, const double y, const double z)
Set the x, y, z coordinate to the given.

bool isZero () const
Test if Vector3d is zero.

bool isEqual (const Vector3d v2) const
Test if the two vectors are equals.

bool isNotEqual (const Vector3d v2) const
Test if the two vectors are not equals.

double length () const
Retrieve length of Vector3d.

double lengthSq () const
Retrieve square length of Vector3d.

double getCos (const Vector3d v2) const
Calculate cosine angle between current Vector3d and specified Vector3d.

double getSin (const Vector3d v2) const
Calculate sine angle between current Vector3d and specified Vector3d.

double dot (const Vector3d v2) const
Calculate dot product between current Vector3d and specified Vector3d.

Vector3d cross (const Vector3d v2)
Calculate cross product between current Vector3d and specified Vector3d.

Vector3dproject (const Vector3d v2)
Project current Vector3d onto specified Vector3d.

Vector3d getProjection (const Vector3d *v2)
Project current Vector3d onto specified Vector3d.

double getProjectionRatio (const Vector3d v2) const
Get ratio from projection of current Vector3d onto specified Vector3d.

Vector3dnormalize ()
Normalize current Vector3d.

Vector3d getNormalized ()
Normalize current Vector3d.

Vector3dnegate ()
Negate current Vector3d.

## Public Member Functions

Vector3d ()
Create a new empty Vector3d.

Vector3d (double x, double y, double z)
Create a new Vector3d.

double x
x value

double y
y value

double z
z value

## Detailed Description

The Vector3d class defines a three-dimensional vector container. Vector3d objects can be instantiated in the scripting environment.

You can use it in both Script Editor and scriptModule.

## Constructor & Destructor Documentation

 Vector3d::Vector3d ( )

Create a new empty Vector3d.

 Vector3d::Vector3d ( double x, double y, double z )

Create a new Vector3d.

Parameters
 x X value y Y value z Z value

## Member Function Documentation

 Vector3d Vector3d::cross ( const Vector3d v2 )
slot

Calculate cross product between current Vector3d and specified Vector3d.

Parameters
 v2 Second Vector3d
Returns
Cross product Vector3d value
 double Vector3d::dot ( const Vector3d v2 ) const
slot

Calculate dot product between current Vector3d and specified Vector3d.

Parameters
 v2 Second Vector3d
Returns
Dot product value
 double Vector3d::getCos ( const Vector3d v2 ) const
slot

Calculate cosine angle between current Vector3d and specified Vector3d.

Parameters
 v2 Second Vector3d
Returns
Cosine angle
 Vector3d Vector3d::getNormalized ( )
slot

Normalize current Vector3d.

Returns
new normalized Vector3d
 Vector3d Vector3d::getProjection ( const Vector3d * v2 )
slot

Project current Vector3d onto specified Vector3d.

Parameters
 v2 Vector3d to project onto
Returns
new projected Vector3d
 double Vector3d::getProjectionRatio ( const Vector3d v2 ) const
slot

Get ratio from projection of current Vector3d onto specified Vector3d.

Parameters
 v2 Vector3d to project onto
Returns
ratio value
 double Vector3d::getSin ( const Vector3d v2 ) const
slot

Calculate sine angle between current Vector3d and specified Vector3d.

Parameters
 v2 Second Vector3d
Returns
Sine angle
 bool Vector3d::isEqual ( const Vector3d v2 ) const
slot

Test if the two vectors are equals.

Parameters
 v2 Second Vector3d
Returns
Result of test
 bool Vector3d::isNotEqual ( const Vector3d v2 ) const
slot

Test if the two vectors are not equals.

Parameters
 v2 Second Vector3d
Returns
Result of test
 bool Vector3d::isZero ( ) const
slot

Test if Vector3d is zero.

Returns
Result of test
 double Vector3d::length ( ) const
slot

Retrieve length of Vector3d.

Returns
Length
 double Vector3d::lengthSq ( ) const
slot

Retrieve square length of Vector3d.

Returns
Square length
 Vector3d& Vector3d::negate ( )
slot

Negate current Vector3d.

Returns
Vector3d reference
 Vector3d& Vector3d::normalize ( )
slot

Normalize current Vector3d.

Returns
Vector3d reference
 Vector3d& Vector3d::project ( const Vector3d v2 )
slot

Project current Vector3d onto specified Vector3d.

Parameters
 v2 Vector3d to project onto
Returns
Vector3d reference
 void Vector3d::setXYZ ( const double x, const double y, const double z )
slot

Set the x, y, z coordinate to the given.

## Property Documentation

 double Vector3d::x

x value

 double Vector3d::y