GO2cam Javascript API  6.11
GO2SXYZ Class Reference

Creation of a coordinate reference. More...

Inheritance diagram for GO2SXYZ:
GO2SReference

Public Member Functions

 GO2SXYZ ()
 Create an 'empty' reference at coordinates (0,0,0)
 
 GO2SXYZ (GO2SEnum::GO2SAxis axis)
 Creation of a reference on an axis direction.
 
 GO2SXYZ (Number x, Number y, Number z)
 Creation of a reference at given coordinates.
 
void Add (GO2SXYZ other)
 Add a vector XYZ to the object.
 
GO2SXYZ Added (GO2SXYZ other)
 
GO2SXYZ CrossProduct (GO2SXYZ other)
 
Number Distance (GO2SXYZ other)
 
Number Distance2D (GO2SXYZ other)
 
Number DotProduct (GO2SXYZ other)
 
Boolean IsPolar ()
 
void Normalize ()
 Normalize a vector XYZ.
 
GO2SXYZ Normalized ()
 
GO2SXYZ Perpendicular ()
 
void Scale (Number v)
 Scale a vector XYZ.
 
GO2SXYZ Scaled (Number v)
 
GO2SEnum::GO2SError SetPolarPosition (Number radius, Number angle, Number altitude=0)
 
GO2SEnum::GO2SError SetPolarRelativeTo (GO2SXYZ point, Number radius, Number angle, Number altitude=0)
 
GO2SEnum::GO2SError SetPosition (Number x, Number y, Number z)
 
GO2SEnum::GO2SError SetRelativeTo (GO2SXYZ point, Number vx, Number vy, Number altitude=0)
 
void Subtract (GO2SXYZ other)
 Subtract a vector XYZ.
 
GO2SXYZ Subtracted (GO2SXYZ other)
 
String toString ()
 
Number X ()
 
Number Y ()
 
Number Z ()
 
- Public Member Functions inherited from GO2SReference
GO2SGeometry GetGeometry ()
 
Boolean IsOnEdge ()
 
Boolean IsOnFace ()
 
Boolean IsOnGeometry ()
 

Detailed Description

Creation of a coordinate reference.

A coordinate reference is a XYZ container to manage coordinates or vectors. It is also a 'smart container' for XYZ coordinates by storing construction history. For exemple, if initialized with GO2SGeometry::GetFirstPoint, the coordinates will keep anchored to the first point of the geometry if updated

Constructor & Destructor Documentation

◆ GO2SXYZ() [1/2]

GO2SXYZ::GO2SXYZ ( Number x,
Number y,
Number z )
inline

Creation of a reference at given coordinates.

Parameters
[in]xx coordinate
[in]yy coordinate
[in]zz coordinate

◆ GO2SXYZ() [2/2]

GO2SXYZ::GO2SXYZ ( GO2SEnum::GO2SAxis axis)

Creation of a reference on an axis direction.

Parameters
[in]axisaxis

Member Function Documentation

◆ Add()

void GO2SXYZ::Add ( GO2SXYZ other)
inline

Add a vector XYZ to the object.

Parameters
[in]otherother vector to add

◆ Added()

GO2SXYZ GO2SXYZ::Added ( GO2SXYZ other)
inline
Returns
the addition of 2 vectors XYZ
Parameters
[in]otherother vector to add

◆ CrossProduct()

GO2SXYZ GO2SXYZ::CrossProduct ( GO2SXYZ other)
inline
Returns
the cross product with another vector
Parameters
[in]otherother vector

◆ Distance()

Number GO2SXYZ::Distance ( GO2SXYZ other)
Returns
the distance to another point

◆ Distance2D()

Number GO2SXYZ::Distance2D ( GO2SXYZ other)
Returns
the 2D distance (Z coordinate is ignored) to another point

◆ DotProduct()

Number GO2SXYZ::DotProduct ( GO2SXYZ other)
inline
Returns
the dot (scalar) product with another
Parameters
[in]otherother vector

◆ IsPolar()

Boolean GO2SXYZ::IsPolar ( )
inline

Get if the reference is polar

Returns
true if polar, false if cartesian

◆ Normalized()

GO2SXYZ GO2SXYZ::Normalized ( )
inline
Returns
a normalized vector XYZ

◆ Perpendicular()

GO2SXYZ GO2SXYZ::Perpendicular ( )
inline
Returns
a perpendicular vector XYZ

◆ Scale()

void GO2SXYZ::Scale ( Number v)
inline

Scale a vector XYZ.

Parameters
[in]vscale factor

◆ Scaled()

GO2SXYZ GO2SXYZ::Scaled ( Number v)
inline
Returns
a scaled vector XYZ
Parameters
[in]vscale factor

◆ SetPolarPosition()

GO2SEnum::GO2SError GO2SXYZ::SetPolarPosition ( Number radius,
Number angle,
Number altitude = 0 )

Create a reference at given polar coordinates

Returns
GO2SError.success (0) if success, see GO2SError otherwise
Parameters
[in]radiusthe radius in mm
[in]anglean angle in degree
[in]altitudethe altitude of the point

◆ SetPolarRelativeTo()

GO2SEnum::GO2SError GO2SXYZ::SetPolarRelativeTo ( GO2SXYZ point,
Number radius,
Number angle,
Number altitude = 0 )

Create a reference relative to another with polar coordinates

Returns
GO2SError.success (0) if success, see GO2SError otherwise
Parameters
[in]pointthe point on which the new point will be relative
[in]radiusthe radius in mm
[in]anglean angle in degree
[in]altitudethe altitude of the point

◆ SetPosition()

GO2SEnum::GO2SError GO2SXYZ::SetPosition ( Number x,
Number y,
Number z )

Create a reference at given coordinates

Returns
GO2SError.success (0) if success, see GO2SError otherwise
Parameters
[in]xx coordinate
[in]yy coordinate
[in]zz coordinate

◆ SetRelativeTo()

GO2SEnum::GO2SError GO2SXYZ::SetRelativeTo ( GO2SXYZ point,
Number vx,
Number vy,
Number altitude = 0 )

Set a reference relative to another point

Returns
GO2SError.success (0) if success, see GO2SError otherwise
Parameters
[in]pointthe point
[in]vxdistance in x-axis of the point
[in]vydistance in y-axis of the point
[in]altitudethe altitude of the point

◆ Subtract()

void GO2SXYZ::Subtract ( GO2SXYZ other)
inline

Subtract a vector XYZ.

Parameters
[in]otherother vector to subtract

◆ Subtracted()

GO2SXYZ GO2SXYZ::Subtracted ( GO2SXYZ other)
inline
Returns
the subtraction of 2 vectors XYZ
Parameters
[in]otherother vector to subtract

◆ toString()

String GO2SXYZ::toString ( )

Convert a GO2SXYZ to a string (for debugging purpose using console.log)

Returns
a string describing the object (coordinates...)

◆ X()

Number GO2SXYZ::X ( )
inline
Returns
x coordinate (or radius if polar) of the vector

◆ Y()

Number GO2SXYZ::Y ( )
inline
Returns
y coordinate (or angle in degree if polar) of the vector

◆ Z()

Number GO2SXYZ::Z ( )
inline
Returns
z coordinate of the vector