#include <points.h>
List of all members.
Public Member Functions |
| FCOORD () |
| empty constructor
|
| FCOORD (float xvalue, float yvalue) |
| FCOORD (ICOORD icoord) |
float | x () const |
float | y () const |
void | set_x (float xin) |
| rewrite function
|
void | set_y (float yin) |
| rewrite function
|
float | sqlength () const |
| find sq length
|
float | length () const |
| find length
|
float | pt_to_pt_sqdist (const FCOORD &pt) const |
| sq dist between pts
|
float | pt_to_pt_dist (const FCOORD &pt) const |
| Distance between pts.
|
float | angle () const |
| find angle
|
bool | normalise () |
| Convert to unit vec.
|
BOOL8 | operator== (const FCOORD &other) |
| test equality
|
BOOL8 | operator!= (const FCOORD &other) |
| test inequality
|
void | rotate (const FCOORD vec) |
void | unrotate (const FCOORD &vec) |
Friends |
FCOORD | operator! (const FCOORD &) |
| rotate 90 deg anti
|
FCOORD | operator- (const FCOORD &) |
| unary minus
|
FCOORD | operator+ (const FCOORD &, const FCOORD &) |
| add
|
FCOORD & | operator+= (FCOORD &, const FCOORD &) |
| add
|
FCOORD | operator- (const FCOORD &, const FCOORD &) |
| subtract
|
FCOORD & | operator-= (FCOORD &, const FCOORD &) |
| subtract
|
float | operator% (const FCOORD &, const FCOORD &) |
| scalar product
|
float | operator* (const FCOORD &, const FCOORD &) |
| cross product
|
FCOORD | operator* (const FCOORD &, float) |
| multiply
|
FCOORD | operator* (float, const FCOORD &) |
| multiply
|
FCOORD & | operator*= (FCOORD &, float) |
| multiply
|
FCOORD | operator/ (const FCOORD &, float) |
| divide
|
FCOORD & | operator/= (FCOORD &, float) |
| divide
|
Detailed Description
Definition at line 189 of file points.h.
Constructor & Destructor Documentation
FCOORD::FCOORD |
( |
| ) |
[inline] |
empty constructor
Definition at line 193 of file points.h.
FCOORD::FCOORD |
( |
float |
xvalue, |
|
|
float |
yvalue |
|
) |
| [inline] |
constructor
- Parameters:
-
xvalue | x value |
yvalue | y value |
Definition at line 198 of file points.h.
{
xcoord = xvalue;
ycoord = yvalue;
}
FCOORD::FCOORD |
( |
ICOORD |
icoord | ) |
[inline] |
Member Function Documentation
float FCOORD::angle |
( |
| ) |
const [inline] |
find angle
Definition at line 249 of file points.h.
{
return (float) atan2 (ycoord, xcoord);
}
float FCOORD::length |
( |
| ) |
const [inline] |
bool FCOORD::normalise |
( |
| ) |
|
BOOL8 FCOORD::operator!= |
( |
const FCOORD & |
other | ) |
[inline] |
test inequality
Definition at line 261 of file points.h.
{
return xcoord != other.xcoord || ycoord != other.ycoord;
}
BOOL8 FCOORD::operator== |
( |
const FCOORD & |
other | ) |
[inline] |
test equality
Definition at line 257 of file points.h.
{
return xcoord == other.xcoord && ycoord == other.ycoord;
}
float FCOORD::pt_to_pt_dist |
( |
const FCOORD & |
pt | ) |
const [inline] |
Distance between pts.
Definition at line 244 of file points.h.
float FCOORD::pt_to_pt_sqdist |
( |
const FCOORD & |
pt | ) |
const [inline] |
sq dist between pts
Definition at line 235 of file points.h.
{
FCOORD gap;
gap.xcoord = xcoord - pt.xcoord;
gap.ycoord = ycoord - pt.ycoord;
return gap.sqlength ();
}
void FCOORD::rotate |
( |
const FCOORD |
vec | ) |
[inline] |
rotate
- Parameters:
-
Definition at line 471 of file ipoints.h.
{
float tmp;
tmp = xcoord * vec.x () - ycoord * vec.y ();
ycoord = ycoord * vec.x () + xcoord * vec.y ();
xcoord = tmp;
}
void FCOORD::set_x |
( |
float |
xin | ) |
[inline] |
rewrite function
Definition at line 216 of file points.h.
void FCOORD::set_y |
( |
float |
yin | ) |
[inline] |
rewrite function
Definition at line 220 of file points.h.
float FCOORD::sqlength |
( |
| ) |
const [inline] |
find sq length
Definition at line 225 of file points.h.
{
return xcoord * xcoord + ycoord * ycoord;
}
void FCOORD::unrotate |
( |
const FCOORD & |
vec | ) |
[inline] |
float FCOORD::x |
( |
| ) |
const [inline] |
float FCOORD::y |
( |
| ) |
const [inline] |
Friends And Related Function Documentation
rotate 90 deg anti
Definition at line 258 of file ipoints.h.
{
FCOORD result;
result.xcoord = -src.ycoord;
result.ycoord = src.xcoord;
return result;
}
float operator% |
( |
const FCOORD & |
op1, |
|
|
const FCOORD & |
op2 |
|
) |
| [friend] |
scalar product
Definition at line 362 of file ipoints.h.
{
return op1.xcoord * op2.xcoord + op1.ycoord * op2.ycoord;
}
float operator* |
( |
const FCOORD & |
op1, |
|
|
const FCOORD & |
op2 |
|
) |
| [friend] |
cross product
Definition at line 375 of file ipoints.h.
{
return op1.xcoord * op2.ycoord - op1.ycoord * op2.xcoord;
}
FCOORD operator* |
( |
const FCOORD & |
op1, |
|
|
float |
scale |
|
) |
| [friend] |
multiply
Definition at line 388 of file ipoints.h.
{
FCOORD result;
result.xcoord = op1.xcoord * scale;
result.ycoord = op1.ycoord * scale;
return result;
}
FCOORD operator* |
( |
float |
scale, |
|
|
const FCOORD & |
op1 |
|
) |
| [friend] |
multiply
Definition at line 399 of file ipoints.h.
{
FCOORD result;
result.xcoord = op1.xcoord * scale;
result.ycoord = op1.ycoord * scale;
return result;
}
multiply
Definition at line 418 of file ipoints.h.
{
op1.xcoord *= scale;
op1.ycoord *= scale;
return op1;
}
add
Definition at line 294 of file ipoints.h.
{
FCOORD sum;
sum.xcoord = op1.xcoord + op2.xcoord;
sum.ycoord = op1.ycoord + op2.ycoord;
return sum;
}
add
Definition at line 312 of file ipoints.h.
{
op1.xcoord += op2.xcoord;
op1.ycoord += op2.ycoord;
return op1;
}
unary minus
Definition at line 276 of file ipoints.h.
{
FCOORD result;
result.xcoord = -src.xcoord;
result.ycoord = -src.ycoord;
return result;
}
subtract
Definition at line 328 of file ipoints.h.
{
FCOORD sum;
sum.xcoord = op1.xcoord - op2.xcoord;
sum.ycoord = op1.ycoord - op2.ycoord;
return sum;
}
subtract
Definition at line 346 of file ipoints.h.
{
op1.xcoord -= op2.xcoord;
op1.ycoord -= op2.ycoord;
return op1;
}
FCOORD operator/ |
( |
const FCOORD & |
op1, |
|
|
float |
scale |
|
) |
| [friend] |
divide
Definition at line 434 of file ipoints.h.
{
FCOORD result;
if (scale != 0) {
result.xcoord = op1.xcoord / scale;
result.ycoord = op1.ycoord / scale;
}
return result;
}
divide
Definition at line 454 of file ipoints.h.
{
if (scale != 0) {
op1.xcoord /= scale;
op1.ycoord /= scale;
}
return op1;
}
The documentation for this class was generated from the following files: