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
The Line.as_segments() function takes in a parameter num_segments and returns a list of Line objects that are of equal length, with each segment being equal to the original line's length divided by num_segments.
For example, if we have a Line object line that has a length of 10 and we call line.as_segments(3), it will return a list of 3 Line objects with each line having a length of 3.33:
The Line.as_points() function takes in a parameter num_pts and returns a list of points that are of equal distance from each other, starting from the a point to the b point of the Line object. The distance between each point is equal to the line length divided by num_pts.
For example, if we have a Line object line that has a length of 10 and we call line.as_points(3), it will return a list of 3 points with each point being 3.33 apart from each other:
In the case of Line.as_segments() you cannot pass a number of segments smaller than 1, as that will return a copy of the original.
In the case of Line.as_points() you cannot pass a number of points smaller than 0, as that will return the line's a and b points. About this we could debate to add a way to only get the points in between a and b with an additional parameter or what the function should return when 0 points are requested. Another thing is that we should decide whether the number of points refer to the total points it returns (meaning it will return a list of size num_pts, a and b included) or just the numbers in between (meaning it will return a list of size 2 + num_pts).
The text was updated successfully, but these errors were encountered:
The
Line.as_segments()
function takes in a parameternum_segments
and returns a list ofLine
objects that are of equal length, with each segment being equal to the original line's length divided bynum_segments
.For example, if we have a
Line
object line that has a length of 10 and we callline.as_segments(3)
, it will return a list of 3 Line objects with each line having a length of 3.33:The
Line.as_points()
function takes in a parameternum_pts
and returns a list of points that are of equal distance from each other, starting from thea
point to theb
point of theLine
object. The distance between each point is equal to the line length divided bynum_pts
.For example, if we have a
Line
object line that has a length of 10 and we callline.as_points(3)
, it will return a list of 3 points with each point being 3.33 apart from each other:In the case of
Line.as_segments()
you cannot pass a number of segments smaller than 1, as that will return a copy of the original.In the case of
Line.as_points()
you cannot pass a number of points smaller than 0, as that will return the line's a and b points. About this we could debate to add a way to only get the points in between a and b with an additional parameter or what the function should return when 0 points are requested. Another thing is that we should decide whether the number of points refer to the total points it returns (meaning it will return a list of size num_pts, a and b included) or just the numbers in between (meaning it will return a list of size 2 + num_pts).The text was updated successfully, but these errors were encountered: