def _make_S_curve(x, range=(-<NUM_LIT>, <NUM_LIT>)):
assert x.ndim == <NUM_LIT:1><EOL>x = x - x.min()<EOL>theta = <NUM_LIT:2> * np.pi * (range[<NUM_LIT:0>] + (range[<NUM_LIT:1>] - range[<NUM_LIT:0>]) * x / x.max())<EOL>X = np.empty((x.shape[<NUM_LIT:0>], <NUM_LIT:2>), dtype=float)<EOL>X[:, <NUM_LIT:0>] = np.sign(theta) * (<NUM_LIT:1> - np.cos(theta))<EOL>X[:, <NUM_LIT:1>] = np.sin(theta)<EOL>X *= x.max() / (<NUM_LIT:2> * np.pi * (range[<NUM_LIT:1>] - range[<NUM_LIT:0>]))<EOL>return X<EOL>
Make a 2D S-curve from a 1D vector