ostk.mathematics.geometry.d3.object.Point

class Point(
self: ostk.mathematics.geometry.d3.object.Point,
first_coordinate: ostk.core.type.Real,
second_coordinate: ostk.core.type.Real,
third_coordinate: ostk.core.type.Real,
)

Bases: Object

Create a 3D point with specified coordinates.

Parameters:
  • first_coordinate (float) -- The x-coordinate.

  • second_coordinate (float) -- The y-coordinate.

  • third_coordinate (float) -- The z-coordinate.

Example

>>> point = Point(1.0, 2.0, 3.0)
>>> point.x()  # 1.0
>>> point.y()  # 2.0
>>> point.z()  # 3.0

Methods

apply_transformation

Apply a transformation to the point.

as_cone

Convert the object to a cone.

as_ellipsoid

Convert the object to an ellipsoid.

as_line

Convert the object to a line.

as_line_string

Convert the object to a line string.

as_plane

Convert the object to a plane.

as_point

Convert the object to a point.

as_point_set

Convert the object to a point set.

as_polygon

Convert the object to a polygon.

as_pyramid

Convert the object to a pyramid.

as_ray

Convert the object to a ray.

as_segment

Convert the object to a segment.

as_sphere

Convert the object to a sphere.

as_vector

Convert the point to a 3D vector.

contains

Check if this object contains another object.

distance_to

Calculate the distance to another point.

intersects

Check if this object intersects another object.

is_cone

Check if the object is a cone.

is_defined

Check if the point is defined.

is_ellipsoid

Check if the object is an ellipsoid.

is_line

Check if the object is a line.

is_line_string

Check if the object is a line string.

is_near

Check if this point is near another point within tolerance.

is_plane

Check if the object is a plane.

is_point

Check if the object is a point.

is_point_set

Check if the object is a point set.

is_polygon

Check if the object is a polygon.

is_pyramid

Check if the object is a pyramid.

is_ray

Check if the object is a ray.

is_segment

Check if the object is a segment.

is_sphere

Check if the object is a sphere.

origin

Create a point at the origin (0, 0, 0).

to_string

Convert the point to a string representation.

undefined

Create an undefined point.

vector

Create a point from a 3D vector.

x

Get the x-coordinate of the point.

y

Get the y-coordinate of the point.

z

Get the z-coordinate of the point.

__add__(
self: ostk.mathematics.geometry.d3.object.Point,
arg0: numpy.ndarray[numpy.float64[3, 1]],
) ostk.mathematics.geometry.d3.object.Point
apply_transformation(
self: ostk.mathematics.geometry.d3.object.Point,
transformation: ostk::mathematics::geometry::d3::Transformation,
) None

Apply a transformation to the point.

Parameters:

transformation (Transformation) -- The transformation to apply.

Returns:

The transformed point.

Return type:

Point

Example

>>> point = Point(1.0, 2.0, 3.0)
>>> transformation = Transformation.identity()
>>> transformed = point.apply_transformation(transformation)
as_cone(
self: ostk.mathematics.geometry.d3.Object,
) ostk::mathematics::geometry::d3::object::Cone

Convert the object to a cone.

Returns:

The cone.

Return type:

Cone

as_ellipsoid(
self: ostk.mathematics.geometry.d3.Object,
) ostk::mathematics::geometry::d3::object::Ellipsoid

Convert the object to an ellipsoid.

Returns:

The ellipsoid.

Return type:

Ellipsoid

as_line(
self: ostk.mathematics.geometry.d3.Object,
) ostk::mathematics::geometry::d3::object::Line

Convert the object to a line.

Returns:

The line.

Return type:

Line

as_line_string(
self: ostk.mathematics.geometry.d3.Object,
) ostk::mathematics::geometry::d3::object::LineString

Convert the object to a line string.

Returns:

The line string.

Return type:

LineString

as_plane(
self: ostk.mathematics.geometry.d3.Object,
) ostk::mathematics::geometry::d3::object::Plane

Convert the object to a plane.

Returns:

The plane.

Return type:

Plane

as_point(
self: ostk.mathematics.geometry.d3.Object,
) ostk::mathematics::geometry::d3::object::Point

Convert the object to a point.

Returns:

The point.

Return type:

Point

as_point_set(
self: ostk.mathematics.geometry.d3.Object,
) ostk::mathematics::geometry::d3::object::PointSet

Convert the object to a point set.

Returns:

The point set.

Return type:

PointSet

as_polygon(
self: ostk.mathematics.geometry.d3.Object,
) ostk::mathematics::geometry::d3::object::Polygon

Convert the object to a polygon.

Returns:

The polygon.

Return type:

Polygon

as_pyramid(
self: ostk.mathematics.geometry.d3.Object,
) ostk::mathematics::geometry::d3::object::Pyramid

Convert the object to a pyramid.

Returns:

The pyramid.

Return type:

Pyramid

as_ray(
self: ostk.mathematics.geometry.d3.Object,
) ostk::mathematics::geometry::d3::object::Ray

Convert the object to a ray.

Returns:

The ray.

Return type:

Ray

as_segment(
self: ostk.mathematics.geometry.d3.Object,
) ostk::mathematics::geometry::d3::object::Segment

Convert the object to a segment.

Returns:

The segment.

Return type:

Segment

as_sphere(
self: ostk.mathematics.geometry.d3.Object,
) ostk::mathematics::geometry::d3::object::Sphere

Convert the object to a sphere.

Returns:

The sphere.

Return type:

Sphere

as_vector(
self: ostk.mathematics.geometry.d3.object.Point,
) numpy.ndarray[numpy.float64[3, 1]]

Convert the point to a 3D vector.

Returns:

The point as a 3D vector.

Return type:

Vector3d

Example

>>> point = Point(1.0, 2.0, 3.0)
>>> vector = point.as_vector()  # numpy.array([1.0, 2.0, 3.0])
contains(
self: ostk.mathematics.geometry.d3.Object,
arg0: ostk.mathematics.geometry.d3.Object,
) bool

Check if this object contains another object.

Parameters:

object (Object) -- The object to check containment of.

Returns:

True if this object contains the other object.

Return type:

bool

Example

>>> object = Cone(Point(1.0, 2.0, 3.0), [0.0, 0.0, 1.0], Angle.degrees(30.0))
>>> other_object = Point(1.0, 2.0, 3.1)
>>> object.contains(other_object)  # True
distance_to(
self: ostk.mathematics.geometry.d3.object.Point,
point: ostk.mathematics.geometry.d3.object.Point,
) ostk.core.type.Real

Calculate the distance to another point.

Parameters:

point (Point) -- The other point.

Returns:

The distance between the points.

Return type:

float

Example

>>> point1 = Point(0.0, 0.0, 0.0)
>>> point2 = Point(3.0, 4.0, 0.0)
>>> point1.distance_to(point2)  # 5.0
intersects(
self: ostk.mathematics.geometry.d3.Object,
arg0: ostk.mathematics.geometry.d3.Object,
) bool

Check if this object intersects another object.

Parameters:

object (Object) -- The object to check intersection with.

Returns:

True if the objects intersect.

Return type:

bool

Example

>>> object = Cone(Point(1.0, 2.0, 3.0), [0.0, 0.0, 1.0], Angle.degrees(30.0))
>>> other_object = Point(1.0, 2.0, 3.1)
>>> object.intersects(other_object)  # True
is_cone(self: ostk.mathematics.geometry.d3.Object) bool

Check if the object is a cone.

Returns:

True if the object is a cone.

Return type:

bool

is_defined(self: ostk.mathematics.geometry.d3.object.Point) bool

Check if the point is defined.

Returns:

True if the point is defined, False otherwise.

Return type:

bool

Example

>>> point = Point(1.0, 2.0, 3.0)
>>> point.is_defined()  # True
is_ellipsoid(self: ostk.mathematics.geometry.d3.Object) bool

Check if the object is an ellipsoid.

Returns:

True if the object is an ellipsoid.

Return type:

bool

is_line(self: ostk.mathematics.geometry.d3.Object) bool

Check if the object is a line.

Returns:

True if the object is a line.

Return type:

bool

is_line_string(self: ostk.mathematics.geometry.d3.Object) bool

Check if the object is a line string.

Returns:

True if the object is a line string.

Return type:

bool

is_near(
self: ostk.mathematics.geometry.d3.object.Point,
point: ostk.mathematics.geometry.d3.object.Point,
tolerance: ostk.core.type.Real,
) bool

Check if this point is near another point within tolerance.

Parameters:
  • point (Point) -- The point to compare with.

  • tolerance (float) -- The tolerance for comparison.

Returns:

True if points are within tolerance, False otherwise.

Return type:

bool

Example

>>> point1 = Point(1.0, 2.0, 3.0)
>>> point2 = Point(1.1, 2.1, 3.1)
>>> point1.is_near(point2, 0.2)  # True
is_plane(self: ostk.mathematics.geometry.d3.Object) bool

Check if the object is a plane.

Returns:

True if the object is a plane.

Return type:

bool

is_point(self: ostk.mathematics.geometry.d3.Object) bool

Check if the object is a point.

Returns:

True if the object is a point.

Return type:

bool

is_point_set(self: ostk.mathematics.geometry.d3.Object) bool

Check if the object is a point set.

Returns:

True if the object is a point set.

Return type:

bool

is_polygon(self: ostk.mathematics.geometry.d3.Object) bool

Check if the object is a polygon.

Returns:

True if the object is a polygon.

Return type:

bool

is_pyramid(self: ostk.mathematics.geometry.d3.Object) bool

Check if the object is a pyramid.

Returns:

True if the object is a pyramid.

Return type:

bool

is_ray(self: ostk.mathematics.geometry.d3.Object) bool

Check if the object is a ray.

Returns:

True if the object is a ray.

Return type:

bool

is_segment(self: ostk.mathematics.geometry.d3.Object) bool

Check if the object is a segment.

Returns:

True if the object is a segment.

Return type:

bool

is_sphere(self: ostk.mathematics.geometry.d3.Object) bool

Check if the object is a sphere.

Returns:

True if the object is a sphere.

Return type:

bool

static origin() ostk.mathematics.geometry.d3.object.Point

Create a point at the origin (0, 0, 0).

Returns:

A point at coordinates (0, 0, 0).

Return type:

Point

Example

>>> origin = Point.origin()
>>> origin.x()  # 0.0
>>> origin.y()  # 0.0
>>> origin.z()  # 0.0
to_string(
self: ostk.mathematics.geometry.d3.object.Point,
precision: ostk.core.type.Integer = Undefined,
) ostk.core.type.String

Convert the point to a string representation.

Parameters:

precision (int, optional) -- Number of decimal places. Defaults to DEFAULT_PRECISION.

Returns:

String representation of the point.

Return type:

str

Example

>>> point = Point(1.123456, 2.345678, 3.567890)
>>> point.to_string(3)  # "[1.123, 2.346, 3.568]"
static undefined() ostk.mathematics.geometry.d3.object.Point

Create an undefined point.

Returns:

An undefined point.

Return type:

Point

Example

>>> undefined_point = Point.undefined()
>>> undefined_point.is_defined()  # False
static vector(
vector: numpy.ndarray[numpy.float64[3, 1]],
) ostk.mathematics.geometry.d3.object.Point

Create a point from a 3D vector.

Parameters:

vector (numpy.array) -- The vector to convert to a point.

Returns:

A point with coordinates from the vector.

Return type:

Point

Example

>>> vector = numpy.array([1.0, 2.0, 3.0])
>>> point = Point.vector(vector)  # Point(1.0, 2.0, 3.0)
x(self: ostk.mathematics.geometry.d3.object.Point) ostk.core.type.Real

Get the x-coordinate of the point.

Returns:

The x-coordinate.

Return type:

float

Example

>>> point = Point(1.0, 2.0, 3.0)
>>> point.x()  # 1.0
y(self: ostk.mathematics.geometry.d3.object.Point) ostk.core.type.Real

Get the y-coordinate of the point.

Returns:

The y-coordinate.

Return type:

float

Example

>>> point = Point(1.0, 2.0, 3.0)
>>> point.y()  # 2.0
z(self: ostk.mathematics.geometry.d3.object.Point) ostk.core.type.Real

Get the z-coordinate of the point.

Returns:

The z-coordinate.

Return type:

float

Example

>>> point = Point(1.0, 2.0, 3.0)
>>> point.z()  # 3.0