Boost.Geometry    Boost C++ Libraries
Functions
arithmetic: arithmetic operations on points

Functions

template<typename Point1 , typename Point2 >
void boost::geometry::add_point (Point1 &p1, Point2 const &p2)
 Adds a point to another. More...
 
template<typename Point >
void boost::geometry::add_value (Point &p, typename detail::param< Point >::type value)
 Adds the same value to each coordinate of a point. More...
 
template<typename Point1 , typename Point2 >
void boost::geometry::assign_point (Point1 &p1, Point2 const &p2)
 Assign a point with another. More...
 
template<typename Point >
void boost::geometry::assign_value (Point &p, typename detail::param< Point >::type value)
 Assign each coordinate of a point the same value. More...
 
template<typename ResultP , typename P1 , typename P2 >
ResultP boost::geometry::cross_product (P1 const &p1, P2 const &p2)
 Computes the cross product of two vectors. More...
 
template<typename P >
boost::geometry::cross_product (P const &p1, P const &p2)
 Computes the cross product of two vectors. More...
 
template<typename Point1 , typename Point2 >
void boost::geometry::divide_point (Point1 &p1, Point2 const &p2)
 Divides a point by another. More...
 
template<typename Point >
void boost::geometry::divide_value (Point &p, typename detail::param< Point >::type value)
 Divides each coordinate of the same point by a value. More...
 
template<typename Point1 , typename Point2 >
select_coordinate_type< Point1,
Point2 >::type 
boost::geometry::dot_product (Point1 const &p1, Point2 const &p2)
 Computes the dot product (or scalar product) of 2 vectors (points). More...
 
template<typename Point1 , typename Point2 >
void boost::geometry::multiply_point (Point1 &p1, Point2 const &p2)
 Multiplies a point by another. More...
 
template<typename Point >
void boost::geometry::multiply_value (Point &p, typename detail::param< Point >::type value)
 Multiplies each coordinate of a point by the same value. More...
 
template<typename Point1 , typename Point2 >
void boost::geometry::subtract_point (Point1 &p1, Point2 const &p2)
 Subtracts a point to another. More...
 
template<typename Point >
void boost::geometry::subtract_value (Point &p, typename detail::param< Point >::type value)
 Subtracts the same value to each coordinate of a point. More...
 

Detailed Description

Function Documentation

template<typename Point >
void boost::geometry::add_value ( Point &  p,
typename detail::param< Point >::type  value 
)

Adds the same value to each coordinate of a point.

Template Parameters
PointAny type fulfilling a Point Concept
Parameters
ppoint
valuevalue to add
template<typename Point1 , typename Point2 >
void boost::geometry::add_point ( Point1 &  p1,
Point2 const &  p2 
)

Adds a point to another.

The coordinates of the second point will be added to those of the first point. The second point is not modified.

Template Parameters
Point1Any type fulfilling a Point Concept
Point2Any type fulfilling a Point Concept
Parameters
p1first point
p2second point
template<typename Point >
void boost::geometry::subtract_value ( Point &  p,
typename detail::param< Point >::type  value 
)

Subtracts the same value to each coordinate of a point.

Template Parameters
PointAny type fulfilling a Point Concept
Parameters
ppoint
valuevalue to subtract
template<typename Point1 , typename Point2 >
void boost::geometry::subtract_point ( Point1 &  p1,
Point2 const &  p2 
)

Subtracts a point to another.

The coordinates of the second point will be subtracted to those of the first point. The second point is not modified.

Template Parameters
Point1Any type fulfilling a Point Concept
Point2Any type fulfilling a Point Concept
Parameters
p1first point
p2second point
template<typename Point >
void boost::geometry::multiply_value ( Point &  p,
typename detail::param< Point >::type  value 
)

Multiplies each coordinate of a point by the same value.

Template Parameters
PointAny type fulfilling a Point Concept
Parameters
ppoint
valuevalue to multiply by
template<typename Point1 , typename Point2 >
void boost::geometry::multiply_point ( Point1 &  p1,
Point2 const &  p2 
)

Multiplies a point by another.

The coordinates of the first point will be multiplied by those of the second point. The second point is not modified.

Template Parameters
Point1Any type fulfilling a Point Concept
Point2Any type fulfilling a Point Concept
Parameters
p1first point
p2second point
Note
This is not a dot, cross or wedge product. It is a mere field-by-field multiplication.
template<typename Point >
void boost::geometry::divide_value ( Point &  p,
typename detail::param< Point >::type  value 
)

Divides each coordinate of the same point by a value.

Template Parameters
PointAny type fulfilling a Point Concept
Parameters
ppoint
valuevalue to divide by
template<typename Point1 , typename Point2 >
void boost::geometry::divide_point ( Point1 &  p1,
Point2 const &  p2 
)

Divides a point by another.

The coordinates of the first point will be divided by those of the second point. The second point is not modified.

Template Parameters
Point1Any type fulfilling a Point Concept
Point2Any type fulfilling a Point Concept
Parameters
p1first point
p2second point
template<typename Point >
void boost::geometry::assign_value ( Point &  p,
typename detail::param< Point >::type  value 
)

Assign each coordinate of a point the same value.

Template Parameters
PointAny type fulfilling a Point Concept
Parameters
ppoint
valuevalue to assign
template<typename Point1 , typename Point2 >
void boost::geometry::assign_point ( Point1 &  p1,
Point2 const &  p2 
)

Assign a point with another.

The coordinates of the first point will be assigned those of the second point. The second point is not modified.

Template Parameters
Point1Any type fulfilling a Point Concept
Point2Any type fulfilling a Point Concept
Parameters
p1first point
p2second point
template<typename ResultP , typename P1 , typename P2 >
ResultP boost::geometry::cross_product ( P1 const &  p1,
P2 const &  p2 
)

Computes the cross product of two vectors.

All vectors should have the same dimension, 3 or 2.

Parameters
p1first vector
p2second vector
Returns
the cross product vector
template<typename P >
P boost::geometry::cross_product ( P const &  p1,
P const &  p2 
)

Computes the cross product of two vectors.

All vectors should have the same dimension, 3 or 2.

Parameters
p1first vector
p2second vector
Returns
the cross product vector
template<typename Point1 , typename Point2 >
select_coordinate_type<Point1, Point2>::type boost::geometry::dot_product ( Point1 const &  p1,
Point2 const &  p2 
)

Computes the dot product (or scalar product) of 2 vectors (points).

Template Parameters
Point1Any type fulfilling a Point Concept
Point2Any type fulfilling a Point Concept
Parameters
p1first point
p2second point
Returns
the dot product

April 2, 2011

Copyright © 2007-2011 Barend Gehrels, Amsterdam, the Netherlands
Copyright © 2008-2011 Bruno Lalande, Paris, France
Copyright © 2009-2010 Mateusz Loskot, London, UK
Documentation is generated by Doxygen