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

2d position coordinates More...

#include <angelcad.h>

Public Member Functions

 pos2d (const pos2d@ other)
 Construct position as copy of other position. More...
 
 pos2d (double x, double y)
 Create 2d position from x and y coordinates. More...
 
double dist (const pos2d@ pos) const
 distance from other position More...
 
double x () const
 x coordinate More...
 
double y () const
 y coordinate More...
 
pos2dopAdd (pos2d@ p1)
 Add 2 positions, return new position: p = p1 + p2. More...
 
pos2dopAdd (vec2d@ v1)
 Add position and vector, return new position: p = p1 + v1. More...
 
pos2dopAdd_r (vec2d@ v1)
 Add vector and position, return new position: p = v1 + p1. More...
 
pos2dopMul (double f1)
 Multiply position by factor, return new position: p = p1 * f1. More...
 
pos2dopMul_r (double f1)
 Multiply position by factor, return new position: p = f1 * p1. More...
 
pos2dopSub (vec2d@ v1)
 Subtract vector from position, return new position: p = p1 - v1. More...
 

Detailed Description

2d position coordinates

a pos2d is a position in 2d space. It is used with 2d objects.

Constructor & Destructor Documentation

◆ pos2d() [1/2]

pos2d::pos2d ( const pos2d other)

Construct position as copy of other position.

Parameters
otherpos2d@

◆ pos2d() [2/2]

pos2d::pos2d ( double  x,
double  y 
)

Create 2d position from x and y coordinates.

Parameters
xdouble, coordinate
ydouble, coordinate

Member Function Documentation

◆ dist()

double pos2d::dist ( const pos2d pos) const

distance from other position

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

◆ opAdd() [1/2]

pos2d@ pos2d::opAdd ( pos2d p1)

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

Parameters
p1pos2d@
Returns
pos2d@

◆ opAdd() [2/2]

pos2d@ pos2d::opAdd ( vec2d v1)

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

Parameters
v1vec2d@
Returns
pos2d@

◆ opAdd_r()

pos2d@ pos2d::opAdd_r ( vec2d v1)

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

Parameters
v1vec2d@
Returns
pos2d@

◆ opMul()

pos2d@ pos2d::opMul ( double  f1)

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

Parameters
f1double
Returns
pos2d@

◆ opMul_r()

pos2d@ pos2d::opMul_r ( double  f1)

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

Parameters
f1double
Returns
pos2d@

◆ opSub()

pos2d@ pos2d::opSub ( vec2d v1)

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

Parameters
v1vec2d@
Returns
pos2d@

◆ x()

double pos2d::x ( ) const

x coordinate

Returns
double, x coordinate

◆ y()

double pos2d::y ( ) const

y coordinate

Returns
double, y coordinate

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