Inlab: Simple Functions
Define the function
string-first, which takes as input a string and returns just the first character as a string. E.g.,string-firstof "hello" is "h".Define the function
string-rest, which takes a string and returns a new string with everything but the first character of the original string. E.g.,string-restof "hello" is "ello".Define the function
scaled-sin, which takes three numbers: mid, scale, and x, and computes sin(x) × scale + mid (which is the sin(x) centered at mid, scaled by scale).Define the function
sin-ball, which takes a Number to pass on as the x input for a scaled-sin centered at 100 and scaled by 50, and produces an image of a circle placed on an empty scene at the resulting y-location (centered in the middle).