Skip to content

Commit 3397e93

Browse files
committed
Line2 documentation improvements
* pygorithm/geometry/line2.py As far as I can tell theres no way to easily get pretty inline code highlighting, so use the recommended double leading/trailing backticks. Also add missing function calculate_y_intercept
1 parent 5812f94 commit 3397e93

File tree

1 file changed

+16
-4
lines changed

1 file changed

+16
-4
lines changed

pygorithm/geometry/line2.py

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ def y_intercept(self):
171171
.. caution::
172172
173173
This function will return a y-intercept for non-vertical
174-
line segments that do not reach :code:`x=0`.
174+
line segments that do not reach ``x=0``.
175175
176176
.. caution::
177177
@@ -191,7 +191,7 @@ def horizontal(self):
191191
Get if this line is horizontal, lazily initialized.
192192
193193
A line is horizontal if it has a slope of 0. This also
194-
means that :code:`start.y == end.y`
194+
means that ``start.y == end.y``
195195
196196
:returns: if this line is horizontal
197197
:rtype: bool
@@ -262,6 +262,18 @@ def __str__(self):
262262

263263
pass
264264

265+
def calculate_y_intercept(offset):
266+
"""
267+
Calculate the y-intercept of this line when it is at the
268+
specified offset.
269+
270+
:param offset: the offset of this line for this calculations
271+
:type offset: :class:`pygorithm.geometry.vector2.Vector2`
272+
:returns: the y-intercept of this line when at offset
273+
:rtype: :class:`numbers.Number`
274+
"""
275+
pass
276+
265277
@staticmethod
266278
def find_intersection(line1, line2, offset1=None, offset2=None, find_mtv=True):
267279
"""
@@ -275,8 +287,8 @@ def find_intersection(line1, line2, offset1=None, offset2=None, find_mtv=True):
275287
276288
There is only a very minor performance improvement by setting find_mtv to
277289
false. It is rare that, if an mtv will be necessary, to find any performance
278-
improvement by first searching with :code:`find_mtv=false` and then later
279-
with :code:`find_mtv=true`
290+
improvement by first searching with ``find_mtv=False`` and then later
291+
with :``find_mtv=True``
280292
281293
.. note::
282294

0 commit comments

Comments
 (0)