# Point (hwx.common.math)¶

A mathematical representation of a point in 3D space.

## Public Methods¶

 static planeFromPoints (pt1, pt2, pt3) along (self, towards, distance) distance (self, x, y=None, z=None) distanceTo (self, x, y=None, z=None) distanceToPlane (self, a, b=None, c=None, d=None) midpt (self, x, y=None, z=None)

## Method Details¶

static planeFromPoints(pt1, pt2, pt3)

Computes the plane defined by the three points.

param pt1

The first point.

type pt1

Point

param pt2

The second point.

type pt2

Point

param pt3

The third point.

type pt3

Point

returns

The constants of the a parametric plane equation.

rtype

tuple

along(self, towards, distance)

Computes the point along the line segment.

Defined by self and ‘towards’, at ‘distance’ from self.

param towards

The end point.

type towards

Point

param distance

The distance from the Point defined in self.

type distance

float

returns

The newly created point.

rtype

Point

distance(self, x, y=None, z=None)

Computes the distance to the point defined by x, y, z.

If y is None, x is assumed to be a point (or list).

param x

The x coordinate or a point.

type x

float | Point | list[float]

param y

The y coordinate.

type y

float

param z

The z coordinate.

type z

float

returns

The distance.

rtype

float

distanceTo(self, x, y=None, z=None)

Computes the distance to the point defined by x, y, z.

If y is None, x is assumed to be a point (or list).

param x

The x coordinate or a point.

type x

float | Point | list[float]

param y

The y coordinate.

type y

float

param z

The z coordinate.

type z

float

returns

The distance.

rtype

float

distanceToPlane(self, a, b=None, c=None, d=None)

Computes the distance to the parametric plane.

The parametric plane is given by the equation is ax + by + cz + d = 0.

If b is None, a is assumed to be a list.

param a

The constant ‘a’ or a list of all constants.

type a

float, list[float]

param b

The constant ‘b’.

type b

float

param c

The constant ‘c’.

type c

float

param d

The constant ‘d’.

type d

float

returns

The distance.

rtype

float

midpt(self, x, y=None, z=None)

Computes the middle point of the line segment between self and the point defined by x, y, z.

If y is None, x is assumed to be a Point (or list).

param x

The x coordinate or a Point.

type x

float | Point | list[float]

param y

The y coordinate.

type y

float

param z

The z coordinate.

type z

float

returns

The middle point.

rtype

Point