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.
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<typename Point1 , typename Point2 >
void | boost::geometry::assign_point (Point1 &p1, Point2 const &p2)
| Assign a point with another.
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<typename Point1 , typename Point2 >
void | boost::geometry::divide_point (Point1 &p1, Point2 const &p2)
| Divides a point by another.
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<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<typename Point1 , typename Point2 >
void | boost::geometry::multiply_point (Point1 &p1, Point2 const &p2)
| Multiplies a point by another.
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<typename Point1 , typename Point2 >
void | boost::geometry::subtract_point (Point1 &p1, Point2 const &p2)
| Subtracts a point to another.
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.

## 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:

  Point | Any type fulfilling a Point Concept

Parameters:

  p | point
  value | value 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:

  Point1 | Any type fulfilling a Point Concept
  Point2 | Any type fulfilling a Point Concept

Parameters:

  p1 | first point
  p2 | second 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:

  Point | Any type fulfilling a Point Concept

Parameters:

  p | point
  value | value 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:

  Point1 | Any type fulfilling a Point Concept
  Point2 | Any type fulfilling a Point Concept

Parameters:

  p1 | first point
  p2 | second 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:

  Point | Any type fulfilling a Point Concept

Parameters:

  p | point
  value | value 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:

  Point1 | Any type fulfilling a Point Concept
  Point2 | Any type fulfilling a Point Concept

Parameters:

  p1 | first point
  p2 | second 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:

  Point | Any type fulfilling a Point Concept

Parameters:

  p | point
  value | value 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:

  Point1 | Any type fulfilling a Point Concept
  Point2 | Any type fulfilling a Point Concept

Parameters:

  p1 | first point
  p2 | second 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:

  Point | Any type fulfilling a Point Concept

Parameters:

  p | point
  value | value 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:

  Point1 | Any type fulfilling a Point Concept
  Point2 | Any type fulfilling a Point Concept

Parameters:

  p1 | first point
  p2 | second point

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:

  Point1 | Any type fulfilling a Point Concept
  Point2 | Any type fulfilling a Point Concept

Parameters:

  p1 | first point
  p2 | second 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