Last edit: 17 Jan 2025 work in progress
We are going to use Geogebra 3D calculator to draw. https://www.geogebra.org/calculator
How to draw a cone in a 3 dimensional space of x, y and z axis?
Starting with an equation of a straight line, r(ฮป), passing through the corner of the cone to center of the base.
r(ฮป) = (cโ, cโ, cโ) + ฮป (dโ, dโ, dโ), where (cโ, cโ, cโ) is the coordinate of the corner of the cone, (dโ, dโ, dโ) is a directional vector, ฮป is a parameter.
Given (x, y, z) = any point on the curved surface of the cone. Their distance, D, would be the perpendicular distance measured from point (x, y, z) to the line r(ฮป).
Let vector A = (dโ, dโ, dโ), vector B = (x - cโ, y - cโ, z - cโ)
/////
Using formula |A x B| = |A||B| sin ฮ, distance D = |B| sin ฮ, rearrange:
|A x B| = |A||B| sin ฮ
|A x B| = |A|D
D = |A x B| / |A|
A x B = (dโ(z - r) - dโ(y - q), dโ(x - p) - dโ(z - r), dโ(y - q) - dโ(x - p))
|A x B| = โ((dโ (z - r) - dโ(y - q))ยฒ + (dโ(x - p) - dโ(z - r))ยฒ + (dโ(y - q) - dโ(x - p))ยฒ)
|A| = โ(dโยฒ + dโยฒ + dโยฒ)
D = โ((dโ (z - r) - dโ(y - q))ยฒ + (dโ(x - p) - dโ(z - r))ยฒ + (dโ(y - q) - dโ(x - p))ยฒ) / โ(dโยฒ + dโยฒ + dโยฒ)