2d position coordinates
More...
#include <angelcad.h>
2d position coordinates
a pos2d is a position in 2d space. It is used with 2d objects.
◆ pos2d() [1/2]
pos2d::pos2d |
( |
const pos2d@ |
other | ) |
|
Construct position as copy of other position.
- Parameters
-
◆ pos2d() [2/2]
pos2d::pos2d |
( |
double |
x, |
|
|
double |
y |
|
) |
| |
Create 2d position from x and y coordinates.
- Parameters
-
x | double, coordinate
|
y | double, coordinate |
◆ dist()
double pos2d::dist |
( |
const pos2d@ |
pos | ) |
const |
distance from other position
- Parameters
-
pos | pos2d@, other position
|
- Returns
- double, distance from pos
◆ opAdd() [1/2]
Add 2 positions, return new position: p = p1 + p2.
- Parameters
-
- Returns
- pos2d@
◆ opAdd() [2/2]
Add position and vector, return new position: p = p1 + v1.
- Parameters
-
- Returns
- pos2d@
◆ opAdd_r()
Add vector and position, return new position: p = v1 + p1.
- Parameters
-
- Returns
- pos2d@
◆ opMul()
pos2d@ pos2d::opMul |
( |
double |
f1 | ) |
|
Multiply position by factor, return new position: p = p1 * f1.
- Parameters
-
- Returns
- pos2d@
◆ opMul_r()
pos2d@ pos2d::opMul_r |
( |
double |
f1 | ) |
|
Multiply position by factor, return new position: p = f1 * p1.
- Parameters
-
- Returns
- pos2d@
◆ opSub()
Subtract vector from position, return new position: p = p1 - v1.
- Parameters
-
- 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: