Connection
Base URL, credentials and a reachable server.
Open the control-point source with its preview fixture and trace the parameter through both interpolation stages before changing the drawing code.
Base URL, credentials and a reachable server.
A model available through the configured endpoint.
Context limits and tool support are determined by the model and server.
from math import isfinite
def quadratic_bezier(points, t):
def valid(v):
return type(v) in (int, float) and -1e100 <= v <= 1e100 and isfinite(v)
if type(points) not in (list, tuple) or len(points) != 3:
raise ValueError("three control points")
if any(type(p) not in (list, tuple) or len(p) != 2 or not all(map(valid,p)) for p in points):
raise ValueError("bounded finite 2D controls")
if not valid(t) or not 0 <= t <= 1: raise ValueError("parameter 0 through 1")
def mix(a,b): return tuple((1-t)*x+t*y for x,y in zip(a,b))
return mix(mix(points[0],points[1]),mix(points[1],points[2]))