assign_values (3 coordinate values)

| Home | Libraries | People | FAQ | More

##### assign_values (3 coordinate values)

Assign three values to a geometry (usually a 3D point)

###### Synopsis

    template<typename Geometry, typename Type>
    void assign_values(Geometry & geometry, Type const & c1, Type const & c2,
                       Type const & c3)

###### Parameters

Type | Concept | Name | Description
--- | --- | --- | ---
Geometry & | Any type fulfilling a Geometry Concept | geometry | A model of the specified concept
Type const & | numerical type (int, double, ttmath, ...) to specify the coordinates | c1 | First coordinate (usually x-coordinate)
Type const & | numerical type (int, double, ttmath, ...) to specify the coordinates | c2 | Second coordinate (usually y-coordinate)
Type const & | numerical type (int, double, ttmath, ...) to specify the coordinates | c3 | Third coordinate (usually z-coordinate)

###### Header

Either

`#include <boost/geometry.hpp>`

Or

`#include <boost/geometry/algorithms/assign.hpp>`

###### Example

Use assign to set three coordinates of a 3D point

    #include <iostream>
    #include <iomanip>

    #include <boost/geometry.hpp>
    #include <boost/geometry/geometries/point.hpp>

    int main()
    {
        boost::geometry::model::point<double, 3, boost::geometry::cs::cartesian> p;
        boost::geometry::assign_values(p, 1.2345, 2.3456, 3.4567);

        std::cout << boost::geometry::dsv(p) << std::endl;

        return 0;
    }

Output:

    (1.2345, 2.3456, 3.4567)

###### See also

- make