# Parametric equation of the square? (or the cube in 3D)

• Nov 15th 2010, 09:33 AM
benoix
Parametric equation of the square? (or the cube in 3D)
Hi,

I need to sample data in space on the faces of a 3D cube.
Is there a parametric equation that approximates the square (in 2D) or the cube (3D) ?

Thanks a lot!
Benoit
• Nov 22nd 2010, 08:39 AM
ragnar
A parametric equation that describes a surface must have two parameters, call them \$\displaystyle u\$ and \$\displaystyle v\$. Suppose you want a plane that runs through a point \$\displaystyle P_{0}\$ which contains two nonparallel lines \$\displaystyle l\$ and \$\displaystyle m\$. (In the case of a square in the first quadrant of a Cartesian plane with a corner at the origin, your point will be anywhere in the square and the lines can be \$\displaystyle y = x\$ and \$\displaystyle y = 2x\$.) Suppose the equations of the lines are given as \$\displaystyle a_{1}x + b_{1}y + c_{1}z = d_{1}\$ and \$\displaystyle a_{2}x + b_{2}y + c_{2}z = d_{2}\$ for constants \$\displaystyle a_{1}, a_{2}, b_{1}..., d_{2}\$ and suppose the point's coordinates are \$\displaystyle (x_{1}, y_{1}, z_{1})\$. Then the parametric equations of the plane will be \$\displaystyle x = x_{1} + ua_{1} + va_{2}, y = y_{1} + ub_{1} + vb_{2}, z = z_{1} + uc_{1} + vc_{2}\$.

Probably the lesson here is that, whatever you're doing, you don't want to be doing it with parametric equations. I could be wrong.
• Nov 22nd 2010, 08:48 AM
benoix
Hi Ragnar,

Thank you very much for your answer! In fact i do need to sample data on the surface of the cube (or more precisely on a \$\displaystyle C^1\$ surface very close to the cube).
That's to find an optimal configuration of points on the cube for a given energy ( minimization with least square criteria).
The best would be maybe to look at spherical coordinates, it might be more easy...

Thanks again