To represent a point in some Cartesian space, use a constructor of this general form.
You may pass the
y coordinates to the
constructor as two separate arguments, or as a sequence
of two numbers (
y). The sequences can be
either Python tuples or lists.
There is one more option for the constructor argument.
You may provide a single argument containing a sequence
of three values (
W), for a coordinate that is already
in homogeneous form.
Methods of this class include:
Returns the coordinates as a 2-tuple.
Given a point
Pt instance, this
method returns the distance between
Given another point
this method returns the Cartesian angle from
self to that point in radians: 0 is the
bearing of the
and π/2 is the bearing of the
Given a distance
bearing as a
Cartesian angle in radians, return the point at
that distance and bearing as a new
Returns self in polar coordinates, as instances of
the class described in Section 3.3, “The
Returns self as a string of the form
The sum of two
Pt instances is a new
Pt instance whose coordinates are the
sum of the coordinates of
The difference of two
Pt instances is
Pt instance whose coordinates are
the differences of the coordinates of
Returns 0 if the two points coincide; returns a nonzero value otherwise.