Skip to content

Commit 73ed3dc

Browse files
committed
Updated docs to fix stubs and clarify docs a bit
1 parent 631cab3 commit 73ed3dc

File tree

2 files changed

+12
-10
lines changed

2 files changed

+12
-10
lines changed

docs/reST/ref/math.rst

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -385,13 +385,14 @@ Conversion can be combined with swizzling or slicing to create a new order
385385
.. method:: lerp
386386

387387
| :sl:`returns a linear interpolation to the given vector.`
388-
| :sg:`lerp(Vector2, float, /) -> Vector2`
389-
| :sg:`lerp(Vector2, float, bool, /) -> Vector2`
388+
| :sg:`lerp(Vector2, float, do_clamp=True, /) -> Vector2`
390389
391390
Returns a Vector which is a linear interpolation between self and the
392391
given Vector. The second parameter determines how far between self and
393392
other the result is going to be. It must be a value between ``0`` and ``1``
394-
where ``0`` means self and ``1`` means other will be returned.
393+
when ``do_clamp`` is ``True`` where ``0`` means self and ``1`` means other
394+
will be returned. When ``do_clamp`` is ``False``, the lerp will extend out
395+
linearly when the second parameter is outside of the nominal range.
395396

396397
.. versionchanged:: 2.5.7 The ``do_clamp`` parameter is added with a default
397398
value of ``True``. When it's ``True``, the second parameter is limited
@@ -880,13 +881,14 @@ Conversion can be combined with swizzling or slicing to create a new order
880881
.. method:: lerp
881882

882883
| :sl:`returns a linear interpolation to the given vector.`
883-
| :sg:`lerp(Vector3, float, /) -> Vector3`
884-
| :sg:`lerp(Vector3, float, bool, /)`
884+
| :sg:`lerp(Vector3, float, do_clamp=True, /) -> Vector3`
885885
886886
Returns a Vector which is a linear interpolation between self and the
887-
given Vector. The second parameter determines how far between self an
888-
other the result is going to be. It must be a value between ``0`` and
889-
``1``, where ``0`` means self and ``1`` means other will be returned.
887+
given Vector. The second parameter determines how far between self and
888+
other the result is going to be. It must be a value between ``0`` and ``1``
889+
when ``do_clamp`` is ``True`` where ``0`` means self and ``1`` means other
890+
will be returned. When ``do_clamp`` is ``False``, the lerp will extend out
891+
linearly when the second parameter is outside of the nominal range.
890892

891893
.. versionchanged:: 2.5.7 The ``do_clamp`` parameter is added with a default
892894
value of ``True``. When it's ``True``, the second parameter is limited

src_c/doc/math_doc.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
#define DOC_MATH_VECTOR2_DISTANCESQUAREDTO "distance_squared_to(Vector2, /) -> float\ncalculates the squared Euclidean distance to a given vector."
2323
#define DOC_MATH_VECTOR2_MOVETOWARDS "move_towards(Vector2, float, /) -> Vector2\nreturns a vector moved toward the target by a given distance."
2424
#define DOC_MATH_VECTOR2_MOVETOWARDSIP "move_towards_ip(Vector2, float, /) -> None\nmoves the vector toward its target at a given distance."
25-
#define DOC_MATH_VECTOR2_LERP "lerp(Vector2, float, /) -> Vector2\nlerp(Vector2, float, bool, /) -> Vector2\nreturns a linear interpolation to the given vector."
25+
#define DOC_MATH_VECTOR2_LERP "lerp(Vector2, float, do_clamp=True, /) -> Vector2\nreturns a linear interpolation to the given vector."
2626
#define DOC_MATH_VECTOR2_SLERP "slerp(Vector2, float, /) -> Vector2\nreturns a spherical interpolation to the given vector."
2727
#define DOC_MATH_VECTOR2_SMOOTHSTEP "smoothstep(Vector2, float, /) -> Vector2\nreturns a smooth interpolation to the given vector."
2828
#define DOC_MATH_VECTOR2_ELEMENTWISE "elementwise() -> VectorElementwiseProxy\nThe next operation will be performed elementwise."
@@ -59,7 +59,7 @@
5959
#define DOC_MATH_VECTOR3_DISTANCESQUAREDTO "distance_squared_to(Vector3, /) -> float\ncalculates the squared Euclidean distance to a given vector."
6060
#define DOC_MATH_VECTOR3_MOVETOWARDS "move_towards(Vector3, float, /) -> Vector3\nreturns a vector moved toward the target by a given distance."
6161
#define DOC_MATH_VECTOR3_MOVETOWARDSIP "move_towards_ip(Vector3, float, /) -> None\nmoves the vector toward its target at a given distance."
62-
#define DOC_MATH_VECTOR3_LERP "lerp(Vector3, float, /) -> Vector3\nreturns a linear interpolation to the given vector."
62+
#define DOC_MATH_VECTOR3_LERP "lerp(Vector3, float, do_clamp=True, /) -> Vector3\nreturns a linear interpolation to the given vector."
6363
#define DOC_MATH_VECTOR3_SLERP "slerp(Vector3, float, /) -> Vector3\nreturns a spherical interpolation to the given vector."
6464
#define DOC_MATH_VECTOR3_SMOOTHSTEP "smoothstep(Vector3, float, /) -> Vector3\nreturns a smooth interpolation to the given vector."
6565
#define DOC_MATH_VECTOR3_ELEMENTWISE "elementwise() -> VectorElementwiseProxy\nThe next operation will be performed elementwise."

0 commit comments

Comments
 (0)