Script
Public Slots | Public Member Functions | Properties | List of all members
Vector2d Class Reference

The Vector2d class defines a bi-dimensional vector container. Vector2d objects can be instantiated in the scripting environment. More...

#include <math.h>

Inheritance diagram for Vector2d:
Inheritance graph
[legend]
Collaboration diagram for Vector2d:
Collaboration graph
[legend]

Public Slots

bool isZero () const
 Test if Vector2d is zero.
 
bool isEqual (const Vector2d v2) const
 Test if the two vectors are equals.
 
bool isNotEqual (const Vector2d v2) const
 Test if the two vectors are not equals.
 
double length () const
 Retrieve length of Vector2d.
 
double lengthSq () const
 Retrieve square length of Vector2d.
 
double radianAngle () const
 Retrieve radian angle defined by Vector2d.
 
double degreeAngle () const
 Retrieve degree angle defined by Vector2d.
 
double dot (const Vector2d v2) const
 Calculate dot product between current Vector2d and specified Vector2d.
 
Vector2drotate (double rad)
 Rotate Vector2d counter-clockwise of specified radian angle.
 
Vector2drotate90 ()
 Rotate Vector2d counter-clockwise of 90 degrees.
 
Vector2drotate270 ()
 Rotate Vector2d counter-clockwise of 270 degrees.
 
Vector2dproject (const Vector2d v2)
 Project current Vector2d onto specified Vector2d.
 
Vector2d getProjection (const Vector2d v2)
 Project current Vector2d onto specified Vector2d.
 
Vector2dnormalize ()
 Normalize current Vector2d.
 
Vector2d getNormalized ()
 Normalize current Vector2d.
 
Vector2dnegate ()
 Negate current Vector2d.
 

Public Member Functions

 Vector2d ()
 Create a new empty Vector2d.
 
 Vector2d (double x, double y)
 Create a new Vector2d.
 

Properties

double x
 x value
 
double y
 y value
 

Detailed Description

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

Constructor & Destructor Documentation

Vector2d::Vector2d ( )

Create a new empty Vector2d.

Vector2d::Vector2d ( double  x,
double  y 
)

Create a new Vector2d.

Parameters
xX value
yY value

Member Function Documentation

double Vector2d::degreeAngle ( ) const
slot

Retrieve degree angle defined by Vector2d.

Returns
Degree value
double Vector2d::dot ( const Vector2d  v2) const
slot

Calculate dot product between current Vector2d and specified Vector2d.

Parameters
v2Second Vector2d
Returns
Dot product value
Vector2d Vector2d::getNormalized ( )
slot

Normalize current Vector2d.

Returns
new normalized Vector2d
Vector2d Vector2d::getProjection ( const Vector2d  v2)
slot

Project current Vector2d onto specified Vector2d.

Parameters
v2Vector2d to project onto
Returns
new projected Vector2d
bool Vector2d::isEqual ( const Vector2d  v2) const
slot

Test if the two vectors are equals.

Parameters
v2Second Vector2d
Returns
Result of test
bool Vector2d::isNotEqual ( const Vector2d  v2) const
slot

Test if the two vectors are not equals.

Parameters
v2Second Vector2d
Returns
Result of test
bool Vector2d::isZero ( ) const
slot

Test if Vector2d is zero.

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

Retrieve length of Vector2d.

Returns
Length
double Vector2d::lengthSq ( ) const
slot

Retrieve square length of Vector2d.

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

Negate current Vector2d.

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

Normalize current Vector2d.

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

Project current Vector2d onto specified Vector2d.

Parameters
v2Vector2d to project onto
Returns
Vector2d reference
double Vector2d::radianAngle ( ) const
slot

Retrieve radian angle defined by Vector2d.

Returns
Radian value
Vector2d& Vector2d::rotate ( double  rad)
slot

Rotate Vector2d counter-clockwise of specified radian angle.

Parameters
radRadian angle
Returns
Vector2d reference
Vector2d& Vector2d::rotate270 ( )
slot

Rotate Vector2d counter-clockwise of 270 degrees.

Returns
Vector2d reference
Vector2d& Vector2d::rotate90 ( )
slot

Rotate Vector2d counter-clockwise of 90 degrees.

Returns
Vector2d reference

Property Documentation

double Vector2d::x
readwrite

x value

double Vector2d::y
readwrite

y value


The documentation for this class was generated from the following file: