arithmetic

# arithmetic: arithmetic operations on points

typename Point1
typename Point2
void void boost::geometry::add_point (Point1 &p1, Point2 const &p2) 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. Point1

Any type fulfilling a Point Concept

Point2

Any type fulfilling a Point Concept

p1

first point

p2

second point

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

Adds the same value to each coordinate of a point.

Point

Any type fulfilling a Point Concept

p

point

value

value to add

typename Point1
typename Point2
void void boost::geometry::assign_point (Point1 &p1, Point2 const &p2) 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. Point1

Any type fulfilling a Point Concept

Point2

Any type fulfilling a Point Concept

p1

first point

p2

second point

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

Assign each coordinate of a point the same value.

Point

Any type fulfilling a Point Concept

p

point

value

value to assign

typename Point1
typename Point2
void void boost::geometry::divide_point (Point1 &p1, Point2 const &p2) 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. Point1

Any type fulfilling a Point Concept

Point2

Any type fulfilling a Point Concept

p1

first point

p2

second point

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

Divides each coordinate of the same point by a value.

Point

Any type fulfilling a Point Concept

p

point

value

value to divide by

typename Point1
typename Point2
select_coordinate_type< Point1, Point2 >::type select_coordinate_type<Point1, Point2>::type boost::geometry::dot_product (Point1 const &p1, Point2 const &p2) dot_product Point1 const & p1 Point2 const & p2

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

Point1

Any type fulfilling a Point Concept

Point2

Any type fulfilling a Point Concept

p1

first point

p2

second point

the dot product

typename Point1
typename Point2
void void boost::geometry::multiply_point (Point1 &p1, Point2 const &p2) 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. Point1

Any type fulfilling a Point Concept

Point2

Any type fulfilling a Point Concept

p1

first point

p2

second point

This is *not* a dot, cross or wedge product. It is a mere field-by-field multiplication.

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

Multiplies each coordinate of a point by the same value.

Point

Any type fulfilling a Point Concept

p

point

value

value to multiply by

typename Point1
typename Point2
void void boost::geometry::subtract_point (Point1 &p1, Point2 const &p2) 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. Point1

Any type fulfilling a Point Concept

Point2

Any type fulfilling a Point Concept

p1

first point

p2

second point

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

Subtracts the same value to each coordinate of a point.

Point

Any type fulfilling a Point Concept

p

point

value

value to subtract