You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Note that :py:attr:`~continuedfractions.rational_points.RationalPoint.coordinates` property returns a :py:class:`~continuedfractions.rational_points.RationalPoint.Dim2RationalCoordinates` object, which is a simple :py:class:`tuple`-based wrapper for 2D rational coordinates.
75
+
Note that the :py:attr:`~continuedfractions.rational_points.RationalPoint.coordinates` property returns a :py:class:`~continuedfractions.rational_points.Dim2RationalCoordinates` object, which is a simple :py:class:`tuple`-based wrapper for 2D rational coordinates, which can also be used to access the rational point coordinates:
76
+
77
+
.. code:: python
78
+
79
+
>>> P = RP(F(3, 5), F(4, 5))
80
+
>>> P.coordinates.x
81
+
ContinuedFraction(3, 5)
82
+
>>> P.coordinates.y
83
+
ContinuedFraction(4, 5)
76
84
77
85
As :py:class:`~continuedfractions.rational_points.RationalPoint` objects are also instances of :py:class:`tuple`, they support almost all of the common :py:class:`tuple`-compatible operations including indexing, sorting, iteration, unpacking:
78
86
@@ -282,20 +290,25 @@ Some examples are given below:
282
290
>>> RP(F(1, 2), F(2, 3)).homogeneous_coordinates
283
291
(3, 4, 6)
284
292
285
-
Note that the examples involving ``RP(F(3, 5), F(4, 5))``and``RP(F(5, 13), F(12, 13))``yield the primitive Pythagorean triples :math:`(3, 4, 5)`and :math:`(5, 12, 13)` respectively because the underlying rational points :math:`\left(\frac{3}{5},\frac{4}{5}\right)` and :math:`\left(\frac{5}{13},\frac{12}{13}\right)` fall on the unit circle :math:`x^2 + y^2 = 1` and have numerators which are coprime. The example with ``RP(F(6, 10), F(8, 10))`` yields the non-primitive Pythagorean triple :math:`(6, 8, 10)` which happens to be a scalar multiple :math:`2\cdot(3, 4, 5)` of :math:`(3, 4, 5)`, but both are homogeneous coordinates for the same rational point :math:`\left(\frac{3}{5},\frac{4}{5}\right)`.
293
+
.. note::
286
294
287
-
Also note that :py:attr:`~continuedfractions.rational_points.RationalPoint.homogeneous_coordinates`returns a :py:class:`~continuedfractions.rational_points.Dim3RationalCoordinates`object, which is a simple and scalable :py:class:`tuple`-based wrapper for3D rational coordinates. This means that homogeneous coordinates can be scaled and re-scaled at will:
295
+
The term "minimal" above refers to the fact that the integer coordinates returned by :py:attr:`~continuedfractions.rational_points.RationalPoint.homogeneous_coordinates`are (setwise) coprime and are the smallest possible (in magnitude), by construction, with respect to the coordinates of the original rational point, as will be described below.
288
296
289
-
.. code:: python
297
+
The examples involving ``RP(F(3, 5), F(4, 5))``and``RP(F(5, 13), F(12, 13))``yield the primitive Pythagorean triples :math:`(3, 4, 5)`and :math:`(5, 12, 13)` respectively because the underlying rational points :math:`\left(\frac{3}{5},\frac{4}{5}\right)` and :math:`\left(\frac{5}{13},\frac{12}{13}\right)` fall on the unit circle :math:`x^2 + y^2 = 1` and have numerators which are coprime. The example with ``RP(F(6, 10), F(8, 10))`` yields the non-primitive Pythagorean triple :math:`(6, 8, 10)` which happens to be a scalar multiple :math:`2\cdot(3, 4, 5)` of :math:`(3, 4, 5)`, but both are homogeneous coordinates for the same rational point :math:`\left(\frac{3}{5},\frac{4}{5}\right)`.
298
+
299
+
Note that :py:attr:`~continuedfractions.rational_points.RationalPoint.homogeneous_coordinates` returns a :py:class:`~continuedfractions.rational_points.Dim3RationalCoordinates`object, which is a simple :py:class:`tuple`-based wrapper for3D rational coordinates which are accesible via the object, and the coordinates can be scaled and re-scaled any number of times:
The term "minimal" above refers to the fact that the integer coordinates returned by :py:attr:`~continuedfractions.rational_points.RationalPoint.homogeneous_coordinates` are (setwise) coprime and are the smallest possible (in magnitude), by construction, with respect to the coordinates of the original rational point, as described below.
Users can refer to textbooks for more details on homogeneous coordinates and projective spaces, but, with respect to rational points in the plane, the basic idea is that they can be identified with certain "points" of :math:`\mathbb{P}^2(\mathbb{Q})` which happen to be equivalence classes of type :math:`\left[\frac{a}{c}: \frac{b}{d}: 1\right]` (for :math:`\frac{a}{c}, \frac{b}{d} \in \mathbb{Q}`) under :math:`\sim` (the scalar multiple equivalence relation described above): the mapping :math:`\left(\frac{a}{c},\frac{b}{d}\right) \longmapsto \left[\frac{a}{c},\frac{b}{d},1\right]` is a bijection from :math:`\mathbb{Q}^2` into :math:`\mathbb{P}^2(\mathbb{Q})`, and allows rational points to be studied in a 3D setting.
301
314
@@ -320,10 +333,10 @@ Some examples are given below:
320
333
321
334
.. code:: python
322
335
323
-
>>> RP(F(0, 0)).projective_height
336
+
>>> RP(0, 0).projective_height
324
337
1
325
338
>>> RP(2, F(1, 2)).projective_height
326
-
6
339
+
4
327
340
>>> RP(F(3, 5), F(4, 5)).projective_height
328
341
5
329
342
>>> RP(F(-3, 5), F(4, 5)).projective_height
@@ -339,7 +352,7 @@ Some examples are given below:
0 commit comments