Cyclone 3DR Script
from Technodigit, part of Hexagon. Copyright 1997-2022.
 
Loading...
Searching...
No Matches
SVector Class Reference

The mathematical object vector. More...

#include <SVector3.h>

Inheritance diagram for SVector:
SObject

Public Slots

SVector Add (SVector Vecteur)
 Calculates the sum of the current vector and another vector. More...
 
static Number Angle (SVector V1, SVector V2)
 Compute the angle in degrees between two 3D vectors. More...
 
 ApplyTransformation (SMatrix iMatrix)
 To apply a geometric transformation to the current object by making a product with the given matrix. More...
 
static SVector Cross (SVector V1, SVector V2)
 Make the 3D vectorial product of two 3D vectors (cross product). More...
 
SVector Div (Number Div)
 To divide a vector by a value. More...
 
static Number Dot (SVector V1, SVector V2)
 Make the scalar product of two 3D vectors (dot product). More...
 
Boolean Equals (SVector VectToCompare)
 
Number GetLength ()
 
SVector GetNormalized ()
 Normalize a copy of the current vector. More...
 
Number GetX ()
 
Number GetY ()
 
Number GetZ ()
 
Boolean IsNull ()
 
SVector Mult (Number Multiplicateur)
 To multiply the current vector with a scalar value. More...
 
static SVector New ()
 Default constructor to initialize all values with zero. More...
 
static SVector New (Number X, Number Y, Number Z)
 Constructs a new SVector by defining its data. More...
 
static SVector New (SPoint EndPt)
 Constructor from one point. The result is the vector between the origin (0,0,0) and the point EndPt. More...
 
static SVector New (SPoint StartPt, SPoint EndPt)
 Constructor which initializes the vector between a starting point and an ending point.
In other words the vector is initialized to EndPt-StartPt. More...
 
static SVector New (SVector Other)
 Constructs an SVector by copying the SVector Other. More...
 
 Normalize ()
 Modifies the 3D vector to have its norm equal to 1. More...
 
 Opposite ()
 Calculates a vector's opposite. More...
 
SVector SetNormed ()
 Modifies the 3D vector to have its norm equal to 1. More...
 
 SetX (Number X)
 Sets the X coordinate. More...
 
 SetY (Number Y)
 Sets the Y coordinate. More...
 
 SetZ (Number Z)
 Sets the Z coordinate. More...
 
SVector Sub (SVector Vecteur)
 Calculates the subtraction of the current vector by another vector. More...
 
String toString ()
 Get the type of the variable. More...
 
static String toString ()
 Get the type of the variable. More...
 
String ValuesToString ()
 Get a string representation of the vector. More...
 
- Public Slots inherited from SObject
 Clear ()
 To deallocate memory of the object. More...
 
String toString ()
 Get the type of the variable. More...
 

Detailed Description

The mathematical object vector.

The SVector class provides mathematical vector manipulation.
The SVector creation can be done by calling the static functions:

Member Function Documentation

◆ Add

SVector SVector::Add ( SVector  Vecteur)
slot

Calculates the sum of the current vector and another vector.

Returns
The sum of the current vector and another vector
var myVector = SVector.New(7, 7, 7);
myVector = myVector.Add(SVector.New(3, 3, 3)); // myVector == (10, 10, 10) now

◆ Angle

static Number SVector::Angle ( SVector  V1,
SVector  V2 
)
staticslot

Compute the angle in degrees between two 3D vectors.

Warning
throw an exception if V1 or V2 is null
Return values
Theangle between the 2 vectors (degrees).

◆ ApplyTransformation

SVector::ApplyTransformation ( SMatrix  iMatrix)
slot

To apply a geometric transformation to the current object by making a product with the given matrix.

See also
Translate

◆ Cross

static SVector SVector::Cross ( SVector  V1,
SVector  V2 
)
staticslot

Make the 3D vectorial product of two 3D vectors (cross product).

Returns
The vector V1^V2 is returned.

◆ Div

SVector SVector::Div ( Number  Div)
slot

To divide a vector by a value.

var myVector = SVector.New(4, 4, 4);
myVector = myVector.Div(2); // myVector == (2, 2, 2) now

◆ Dot

static Number SVector::Dot ( SVector  V1,
SVector  V2 
)
staticslot

Make the scalar product of two 3D vectors (dot product).

Returns
The scalar product V1*V2
Parameters
[in]V1First vector
[in]V2Second vector

◆ Equals

Boolean SVector::Equals ( SVector  VectToCompare)
slot
Return values
trueVectors are equal (nearly to epsilon)
falseVectors are not equal (nearly to epsilon)

◆ GetLength

Number SVector::GetLength ( )
slot
Returns
The length of the vector

◆ GetNormalized

SVector SVector::GetNormalized ( )
slot

Normalize a copy of the current vector.

Returns
The normalized vector.
See also
Normalize

◆ GetX

Number SVector::GetX ( )
slot
Returns
The X coordinate.

◆ GetY

Number SVector::GetY ( )
slot
Returns
The Y coordinate.

◆ GetZ

Number SVector::GetZ ( )
slot
Returns
The Z coordinate.

◆ IsNull

Boolean SVector::IsNull ( )
slot
Return values
trueVector is null
falseVector is not null

◆ Mult

SVector SVector::Mult ( Number  Multiplicateur)
slot

To multiply the current vector with a scalar value.

Returns
The product of a vector by a scalar
var myVector = SVector.New(1, 1, 1);
myVector = myVector.Mult(7); // myVector == (7, 7, 7) now

◆ New [1/5]

static SVector SVector::New ( )
staticslot

Default constructor to initialize all values with zero.

◆ New [2/5]

static SVector SVector::New ( Number  X,
Number  Y,
Number  Z 
)
staticslot

Constructs a new SVector by defining its data.

Parameters
[in]XThe X coordinate
[in]YThe Y coordinate
[in]ZThe Z coordinate

◆ New [3/5]

static SVector SVector::New ( SPoint  EndPt)
staticslot

Constructor from one point. The result is the vector between the origin (0,0,0) and the point EndPt.

◆ New [4/5]

static SVector SVector::New ( SPoint  StartPt,
SPoint  EndPt 
)
staticslot

Constructor which initializes the vector between a starting point and an ending point.
In other words the vector is initialized to EndPt-StartPt.

◆ New [5/5]

static SVector SVector::New ( SVector  Other)
staticslot

Constructs an SVector by copying the SVector Other.

◆ Normalize

SVector::Normalize ( )
slot

Modifies the 3D vector to have its norm equal to 1.

See also
GetNormalized

◆ Opposite

SVector::Opposite ( )
slot

Calculates a vector's opposite.

◆ SetNormed

SVector SVector::SetNormed ( )
slot

Modifies the 3D vector to have its norm equal to 1.

Returns
The current modified vector.
Deprecated:
This function is deprecated, use SVector.Normalize() or SVector.GetNormalized() instead.

◆ SetX

SVector::SetX ( Number  X)
slot

Sets the X coordinate.

◆ SetY

SVector::SetY ( Number  Y)
slot

Sets the Y coordinate.

◆ SetZ

SVector::SetZ ( Number  Z)
slot

Sets the Z coordinate.

◆ Sub

SVector SVector::Sub ( SVector  Vecteur)
slot

Calculates the subtraction of the current vector by another vector.

Returns
The subtraction of the current vector and another vector
var myVector = SVector.New(7, 7, 7);
myVector = myVector.Sub(SVector.New(2, 2, 2)); // myVector == (5, 5, 5) now

◆ toString [1/2]

String SVector::toString ( )
slot

Get the type of the variable.

◆ toString [2/2]

static String SVector::toString ( )
staticslot

Get the type of the variable.

◆ ValuesToString

String SVector::ValuesToString ( )
slot

Get a string representation of the vector.