AngelCAD  1.5-00
Public Member Functions | List of all members
pos3d Class Reference

3d position coordinates More...

#include <angelcad.h>

Public Member Functions

 pos3d (const pos3d@ other)
 Construct position as copy of other position. More...
 
 pos3d (double x, double y, double z)
 Create 3d position from x,y and z coordinates. More...
 
double dist (const pos3d@ pos) const
 distance from other position More...
 
double x () const
 x coordinate More...
 
double y () const
 y coordinate More...
 
double z () const
 z coordinate More...
 
pos3dopAdd (pos3d@ p1)
 Add 2 positions, return new position: p = p1 + p2. More...
 
pos3dopAdd (vec3d@ v1)
 Add position and vector, return new position: p = p1 + v1. More...
 
pos3dopAdd_r (vec3d@ v1)
 Add vector and position, return new position: p = v1 + p1. More...
 
pos3dopMul (double f1)
 Multiply position by factor, return new position: p = p1 * f1. More...
 
pos3dopMul_r (double f1)
 Multiply position by factor, return new position: p = f1 * p1. More...
 
pos3dopSub (vec3d@ v1)
 Subtract vector from position, return new position: p = p1 - v1. More...
 

Detailed Description

3d position coordinates

a pos3d is a position in 3d space. It is used with 3d objects.

Constructor & Destructor Documentation

◆ pos3d() [1/2]

pos3d::pos3d ( const pos3d other)

Construct position as copy of other position.

Parameters
otherpos3d@

◆ pos3d() [2/2]

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

Create 3d position from x,y and z coordinates.

Parameters
xdouble, x coordinate
ydouble, y coordinate
zdouble, z coordinate

Member Function Documentation

◆ dist()

double pos3d::dist ( const pos3d pos) const

distance from other position

Parameters
pospos3d@, other position
Returns
double, distance from pos

◆ opAdd() [1/2]

pos3d@ pos3d::opAdd ( pos3d p1)

Add 2 positions, return new position: p = p1 + p2.

Parameters
p1pos3d@
Returns
pos3d@

◆ opAdd() [2/2]

pos3d@ pos3d::opAdd ( vec3d v1)

Add position and vector, return new position: p = p1 + v1.

Parameters
v1vec3d@
Returns
pos3d@

◆ opAdd_r()

pos3d@ pos3d::opAdd_r ( vec3d v1)

Add vector and position, return new position: p = v1 + p1.

Parameters
v1vec3d@
Returns
pos3d@

◆ opMul()

pos3d@ pos3d::opMul ( double  f1)

Multiply position by factor, return new position: p = p1 * f1.

Parameters
f1double
Returns
pos3d@

◆ opMul_r()

pos3d@ pos3d::opMul_r ( double  f1)

Multiply position by factor, return new position: p = f1 * p1.

Parameters
f1double
Returns
pos3d@

◆ opSub()

pos3d@ pos3d::opSub ( vec3d v1)

Subtract vector from position, return new position: p = p1 - v1.

Parameters
v1vec3d@
Returns
pos3d@

◆ x()

double pos3d::x ( ) const

x coordinate

Returns
double, x coordinate

◆ y()

double pos3d::y ( ) const

y coordinate

Returns
double, y coordinate

◆ z()

double pos3d::z ( ) const

z coordinate

Returns
double, z coordinate

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