Note
The documentation on this page was automatically extracted from the DOLFIN C++ code and may need to be edited or expanded.
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.
Create a point at (x, y, z). Default value (0, 0, 0).
Create point from array
Create point from Array
Return address of coordinate in direction i
Return coordinate in direction i
Return x-coordinate
Return y-coordinate
Return z-coordinate
Return coordinate array
Return coordinate array (const. version)
Compute sum of two points
Compute difference of two points
Add given point
Subtract given point
Unary minus
Multiplication with scalar
Incremental multiplication with scalar
Division by scalar
Incremental division by scalar
Assignment operator
Compute squared distance to given point
Point p1(0, 4, 0);
Point p2(2, 0, 4);
info("%g", p1.squared_distance(p2));
output:
6
Compute distance to given point
Point p1(0, 4, 0);
Point p2(2, 0, 4);
info("%g", p1.distance(p2));
output:
6
Compute norm of point representing a vector from the origin
Point p(1.0, 2.0, 2.0);
info("%g", p.norm());
output:
3
Compute norm of point representing a vector from the origin
Point p(1.0, 2.0, 2.0);
info("%g", p.squared_norm());
output:
9
Compute cross product with given vector
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));
output:
2
Rotate around a given axis
Return informal string representation (pretty-print)
Multiplication with scalar