MCPcopy Create free account
hub / github.com/FullControlXYZ/fullcontrol / linspace

Function linspace

fullcontrol/extra_functions.py:100–112  ·  view source on GitHub ↗

Generate evenly spaced floats from start to end. Args: start (float): The starting value of the range. end (float): The ending value of the range. number_of_points (int): The number of points to generate. Returns: list: A list of number_of_points floats

(start: float, end: float, number_of_points: int)

Source from the content-addressed store, hash-verified

98
99
100def linspace(start: float, end: float, number_of_points: int) -> list:
101 '''
102 Generate evenly spaced floats from start to end.
103
104 Args:
105 start (float): The starting value of the range.
106 end (float): The ending value of the range.
107 number_of_points (int): The number of points to generate.
108
109 Returns:
110 list: A list of number_of_points floats, including the start and end values.
111 '''
112 return [start + float(x)/(number_of_points-1)*(end-start) for x in range(number_of_points)]
113
114
115def first_point(steps: list, fully_defined: bool = True) -> Point:

Callers 6

arc_sinewaveXYFunction · 0.85
ramp_xyzFunction · 0.85
ramp_polarFunction · 0.85
arcXYFunction · 0.85
elliptical_arcXYFunction · 0.85
segmented_lineFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected