# Point¶

class dolfin.cpp.mesh.Point(*args)

Bases: object

A Point represents a point in $$\mathbb{R}^3$$ with coordinates $$x, y, z,$$ or alternatively, a vector in $$\mathbb{R}^3$$ , supporting standard operations like the norm, distances, scalar and vector products etc.

Copy constructor

Parameters: Point & p (const) – (Point ) The object to be copied.
array()

Return copy of coordinate array Returns list of double The coordinates.

Return type: std::array< double, 3 >
cross()

Compute cross product with given vector

Parameters: Point & p (const) – (Point ) Another point. const Point Point The cross product.
distance()

Compute distance to given point

Point p1(0, 4, 0);
Point p2(2, 0, 4);
info("%g", p1.distance(p2));

Parameters: Point & p (const) – (Point ) The point to compute distance to. double double The distance.
dot()

Compute dot product with given vector

Point p1(1.0, 4.0, 8.0);
Point p2(2.0, 0.0, 0.0);
info("%g", p1.dot(p2));

Parameters: Point & p (const) – (Point ) Another point. double double The dot product.
norm()

Compute norm of point representing a vector from the origin

Point p(1.0, 2.0, 2.0);
info("%g", p.norm());

Return type: double double The (Euclidean) norm of the vector from the origin to the point.
rotate()

Rotate around a given axis

Parameters: Point & a (const) – (Point ) The axis to rotate around. Must be unit length. theta (double) – (double) The rotation angle. Point Point The rotated point.
squared_distance()

Compute squared distance to given point

Parameters: Point & p (const) – (Point ) The point to compute distance to. double double The squared distance.
squared_norm()

Compute norm of point representing a vector from the origin

Point p(1.0, 2.0, 2.0);
info("%g", p.squared_norm());

Return type: double double The squared (Euclidean) norm of the vector from the origin of the point.
str()

Return informal string representation (pretty-print)

Parameters: verbose (bool) – (bool) Flag to turn on additional output. std::string std::string An informal representation of the function space.
thisown

The membership flag

x()

Return x-coordinate

Return type: double double The x-coordinate.
y()

Return y-coordinate

Return type: double double The y-coordinate.
z()

Return z-coordinate

Return type: double double The z-coordinate.