I am trying to simulate a planet’s orbit, so I made a setup to generate an ellipse for a star and a planet given a couple parameters. It was working fine until I tried to add support for rotating the ellipse in 3d space. I tried to do a quaternion rotation around the major axis of the ellipse but for some reason, the minor axis point (purple sphere in image) is going at a weird 45 degree angle from the center (yellow sphere in image) in the wrong axis. When I change the “angle” parameter it rotates around the major axis fine. I just want to know why that 45 degree angle in the other axis is happening.
Quaternion perpendicularDirection = Quaternion.AngleAxis(angle, majorAxisDirection);
//Finds out what direction we should go from the center to place our minor axis point.
float b = Mathf.Sqrt(a * a - c * c) / 2f; //Ellipse stuff. Unrelated.
Vector3 minorVertex = center + (perpendicularDirection * Vector3.one) * b; //The error might be coming from here, idk.
Visualization of the problem: