Ellipsoid as a Matrix

PrisonLove

Hard Realist
Reaction score
78
How can I represent an Ellipsoid as a matrix?

Assume point P(x,y,z) as the center of the Ellipsoid, and assume that rx, ry, rz are the radii of the x, y, z axes. What is the proper Matrix representation of the Ellipsoid?
 

saw792

Is known to say things. That is all.
Reaction score
280
You cannot represent every ellipsoid with the parameters you have described, only axis-aligned ones in case you weren't aware.

Anyway, there is no 'proper' way to represent an ellipsoid; it depends on what sort of operations you want to perform on it as to what the best representation is. Either way, transformations cannot be implemented in a simple matrix multiplication with this representation. As every border point will be generated from equations such as px = x + rx... (... in this case means some complicated angular calculations) you will have to separate the center coordinates and radii whenever you want to operate on the matrix.

The proper, general formula for an ellipsoid is of the form xTAx = 1 (where xT is the transpose of x and x is a vector) and A is a particular type of matrix that defines the directions of the ellipsoid's "poles" in it's eigenvectors and eigenvalues.

If you'd like to implement the general form in some way let me know and I can help with generating the unique matrix A and help you with turning that into usable, drawable, transformable code.
 

PrisonLove

Hard Realist
Reaction score
78
I basically need this for ray tracing. Given a ray I need to find it's intersection with quadric surfaces, most specifically, ellipsoids, cubes, and cylinders. I figured I would start with Ellipsoids and work from there since they seem to be the easiest and have only one plane equation. I am totally lost on how to intersect the ray with a quadric surface. I know ray's are of the form x = p + tu, and there is some Matrix Q such that xTQx = 0 will give me the intersection. To my knowledge I substitute the ray equation into the matrix equation to get 0 = xTQx = (p + tu)TQ(p + tu), but from there I am lost.

Any help? I'll start with just ellipsoids instead of general quadric surfaces if that makes things easier. I'm trying to get this into Java code.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top