In three dimensions any three points are coplanar, that is, there exists a plane for which all the points lie in that plane. However if you have 4 or more points we would like to test if those points are co-planar. Write a function

Examples: The following sets of points all lie on the same plane $$\{(0,0,0),(1,1,1),(1,0,1)\}$$ $$\{(1,-1,0),(0,1,-1),(1,0,-1),(3,-1,-2)\}$$ $$\{(0,0,0),(1,0,0),(0,1,0),(3,4,0),(2,1,0),(5,1,0)\}$$ $$\{(1,1,1),(2,1,1),(1,2,1),(4,5,1),(3,2,1),(6,2,1)\}$$ $$\{(4,-1,1),(3,1,0),(4,0,0),(6,-1,-1)\}$$ The following sets of points all do not lie on the same plane. $$\{(0,0,0),(1,1,1),(1,0,1),(2,-1,0)\}$$ $$\{(1,-1,0),(0,1,-1),(2,-1,0),(1,0,-1),(3,-1,-2)\}$$ $$\{(0,0,0),(1,0,0),(0,1,0),(3,4,0),(2,1,0),(5,1,0),(1,1,1)\}$$ $$\{(1,1,1),(0,0,0),(2,1,1),(1,2,1),(4,5,1),(3,2,1),(6,2,1)\}$$ $$\{(4,-1,1),(3,1,0),(0,2,3),(4,0,0),(6,-1,-1)\}$$

The vector $( c \cdot cos(\theta), c \cdot sin(\theta), - a \cdot cos(\theta) -b \cdot sin(\theta))$ is perpendicular to the vector $(a,b,c)$ (because the dot product of these two vectors is $0$). If $\theta$ ranges between $0$ and $2 \pi$ then it sweeps out a parametric curve of an ellipse and the plane where the points of the ellipse lies is perpendicular to the vector $(a,b,c)$. If you divide by the length of this vector then it will sweep out a parametric curve of a circle of radius $1$ centered at the origin and this circle is in a plane perpendicular to $(a,b,c)$.

Example: A circle in a plane perpendicular to the vector between $(0,0,0)$ and $(1,1,3)$.

> A:=spacecurve( [3*cos(theta)/dd,3*sin(theta)/dd,(-cos(theta)-sin(theta))/dd], theta=0..2*Pi, numpoints=100):

> display(A,display(line([0,0,0],[1,1,3]),scaling=constrained, linestyle=solid, color=red));

Given a parametric curve in 3-d $(x(t), y(t), z(t))$ such that $(x'(t), y'(t), z'(t))$ is never $(0,0,0)$, write a function

Example:

> spacecurve(swish,t=0..2*Pi);

> plot3d(tubify(swish), theta=0..2*Pi,t=0..2*Pi,grid=[100,100],scaling=constrained);

You should open up a new worksheet and start from scratch. You will have to save your work in a file and upload that file on to the course moodle. Your solution should be a sequence of commands where it is easy to change the input string and after you execute the sequence of commands you should have the correct output string. Please add documentation to your worksheet to explain how it works. Just a few sentences is sufficient, but imagine that you were opening up the worksheet for the first time and wanted to know what it did. You will be marked down if what you write is not clear and coherent.

You should finish your assignment by Wednesday, November 29 by 11:59pm. Assignments submitted after this date will be assessed a penalty of 10% per day.