geom::Point Struct Reference

A class representing a point in a 2-dimensional space. More...

#include <geom.hh>

List of all members.

Public Member Functions

 Point ()
 Create a point.
 Point (float x, float y)
 Create a point (x, y).
Pointrot90 ()
 Rotate the point 90 degrees.
Point get_rot90 () const
 Return the point rotated 90 degrees.
float dot (const Point &p) const
 Compute dot product.
Pointadd (const Point &p, float scale=1)
 Add another point to the point.
Point get_add (const Point &p, float scale=1) const
 Return the result of adding another point from the point.
Pointsub (const Point &p, float scale=1)
 Substract another point from the point.
Point get_sub (const Point &p, float scale=1) const
 Return the result of subtracting another point from the point.
Pointscale (float scale)
 Scale the point.
Point get_scale (float scale)
 Return scaled point.
Pointmean (Point point)
 Compute the mean between two points.
Point get_mean (Point point)
 Return the mean between two points.
float angle () const
 Compute the angle of the vector in radians.
float length () const
 Compute the length of the vector.
Pointnormalize (float length=1)
 Normalize the length of the vector.

Public Attributes

float x
 Coordinate of the point.
float y


Detailed Description

A class representing a point in a 2-dimensional space.


Constructor & Destructor Documentation

geom::Point::Point float  x,
float  y
[inline]
 

Create a point (x, y).

Parameters:
x = the x-coordinate
y = the y-coordinate


Member Function Documentation

Point& geom::Point::add const Point p,
float  scale = 1
[inline]
 

Add another point to the point.

Parameters:
p = the point to add
scale = the scale for p

float geom::Point::angle  )  const [inline]
 

Compute the angle of the vector in radians.

Note:
The angle of (0,0) is also defined. See the man page of atan2 for details.
Returns:
= the angle

float geom::Point::dot const Point p  )  const [inline]
 

Compute dot product.

Parameters:
p = the point to compute the dot product with
Returns:
the dot product

Point geom::Point::get_add const Point p,
float  scale = 1
const [inline]
 

Return the result of adding another point from the point.

Parameters:
p = the point to add
scale = the scale for p

Point geom::Point::get_mean Point  point  )  [inline]
 

Return the mean between two points.

Parameters:
point = the point to compute the mean with

Point geom::Point::get_rot90  )  const [inline]
 

Return the point rotated 90 degrees.

Returns:
The original point rotated 90 degrees.

Point geom::Point::get_scale float  scale  )  [inline]
 

Return scaled point.

Parameters:
scale = the scale

Point geom::Point::get_sub const Point p,
float  scale = 1
const [inline]
 

Return the result of subtracting another point from the point.

Parameters:
p = the point to substract
scale = the scale for p

float geom::Point::length  )  const [inline]
 

Compute the length of the vector.

Returns:
the length

Point& geom::Point::mean Point  point  )  [inline]
 

Compute the mean between two points.

Parameters:
point = the point to compute the mean with

Point& geom::Point::normalize float  length = 1  )  [inline]
 

Normalize the length of the vector.

Parameters:
length = the new length of the vector

Point& geom::Point::scale float  scale  )  [inline]
 

Scale the point.

Parameters:
scale = the scale

Point& geom::Point::sub const Point p,
float  scale = 1
[inline]
 

Substract another point from the point.

Parameters:
p = the point to substract
scale = the scale for p


The documentation for this struct was generated from the following file:
Generated on Tue Apr 8 09:58:19 2008 for GoCam by  doxygen 1.4.6