DsFPoint is a class that represents the X and Y 2D coordinates of a point as floating point numbers.
More...
#include <ds_geometry.h>
|
float | x |
| X component.
|
|
float | y |
| Y component.
|
|
DsFPoint is a class that represents the X and Y 2D coordinates of a point as floating point numbers.
◆ DsFPoint() [1/2]
DsFPoint::DsFPoint |
( |
float |
x, |
|
|
float |
y |
|
) |
| |
|
inline |
Creates a DsFPoint object initialized to (x, y).
- Parameters
-
x | X coordinate |
y | Y coordinate |
◆ DsFPoint() [2/2]
DsFPoint::DsFPoint |
( |
const DsPoint & |
rhs | ) |
|
|
inline |
Assignment operator from a DsFPoint object.
- Parameters
-
◆ distance()
float DsFPoint::distance |
( |
const DsFPoint & |
p | ) |
const |
|
inline |
Calculates the Euclidian distance between the current DsFPoint object and a second DsFPoint object.
- Parameters
-
- Returns
- Euclidian distance
◆ distanceX()
float DsFPoint::distanceX |
( |
const DsFPoint & |
p | ) |
const |
|
inline |
Calculates the X component of the Euclidian distance between the current DsFPoint object and a second DsFPoint object.
- Parameters
-
- Returns
- X component of the Euclidian distance
◆ distanceY()
float DsFPoint::distanceY |
( |
const DsFPoint & |
p | ) |
const |
|
inline |
Calculates the Y component of the Euclidian distance between the current DsFPoint object and a second DsFPoint object.
- Parameters
-
- Returns
- Y component of the Euclidian distance
◆ operator DsPoint()
DsFPoint::operator DsPoint |
( |
| ) |
const |
|
inline |
◆ operator+=() [1/2]
Addition operator - adds a DsFPoint object to the current DsFPoint object.
- Parameters
-
- Returns
- Object reference
◆ operator+=() [2/2]
DsFPoint & DsFPoint::operator+= |
( |
float |
rhs | ) |
|
|
inline |
Addition operator - adds a number to both the X and Y coordinates of the current DsFPoint object.
- Parameters
-
rhs | Right hand side number |
- Returns
- Object reference
◆ operator-()
Unary minus operator. Reverses the signs of both the X and Y coordinates of the current DsFPoint object.
- Returns
- DsFPoint object with both the X and Y components of the current object having the signs reversed
◆ operator-=() [1/2]
Subtraction operator - subtracts a DsFPoint object from the current DsFPoint object.
- Parameters
-
- Returns
- Object reference
◆ operator-=() [2/2]
DsFPoint & DsFPoint::operator-= |
( |
float |
rhs | ) |
|
|
inline |
Subtraction operator - subtracts a number from the current DsFPoint object.
- Parameters
-
rhs | Right hand side number |
- Returns
- Object reference
◆ operator=()
Assignment operator from a DsPoint object.
- Parameters
-
◆ operator==()
bool DsFPoint::operator== |
( |
const DsFPoint & |
rhs | ) |
|
|
inline |
Comparison operator.
- Parameters
-
rhs | Right hand side DsFPoint object of the comparison operator |
◆ saturate()
Saturates the current DsFPoint object coordinates to the minimum and maximum specified.
- Parameters
-
min | Minimum value |
max | Maximum value |
- Returns
- Saturated DsFPoint object
◆ saturateMax()
Saturates the current DsFPoint object coordinates to the maximum specified.
- Parameters
-
- Returns
- Saturated DsFPoint object
◆ saturateMin()
Saturates the current DsFPoint object coordinates to the minimum specified.
- Parameters
-
- Returns
- Saturated DsFPoint object
◆ distance
Calculates the Euclidian distance between two DsFPoint objects.
- Parameters
-
- Returns
- Euclidian distance
◆ operator*
Multiplication operator - multiplies both X and Y coordinates of a DsFPoint object with the same multiplier.
- Parameters
-
lhs | Left hand side point |
multiplier | Right hand side multiplier |
- Returns
- lfs DsFPoint object multiplied by the multiplier
◆ operator+ [1/2]
Addition operator - adds two DsFPoint objects.
- Parameters
-
- Returns
- The sum of lhs and rhs DsFPoint objects
◆ operator+ [2/2]
Addition operator - adds a number to both the X and Y coordinates of a DsFPoint object.
- Parameters
-
lhs | Left hand side DsFPoint object |
rhs | Right hand side number |
- Returns
- The sum of lhs DsFPoint object and the rhs number (x + rhs, y + rhs)
◆ operator- [1/2]
Subtraction operator - subtracts two DsFPoint objects.
- Parameters
-
- Returns
- The difference between lhs and rhs DsFPoint objects
◆ operator- [2/2]
Subtraction operator - subtracts a number from a DsFPoint object.
- Parameters
-
lhs | Left hand side DsFPoint object |
rhs | Right hand side number |
- Returns
- The difference between lhs DsFPoint object and the rhs number (x - rhs, y - rhs)
◆ operator/
Floating point division operator - divides both X and Y coordinates of a DsFPoint object by the same divisor.
- Parameters
-
lhs | Left hand side DsFPoint object |
divisor | Right hand side divisor |
- Returns
- lfs DsFPoint object divided by the divisor
The documentation for this class was generated from the following file: