Quaternion rotations are not working for me right now.

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:

Uhm, Vector3.one is just a short hand for (1,1,1). Are you sure you want that 45° diagonal vector in 3d space? It’s essentially the diagonal of a unit cube.

OK NVM I THINK I JUST FIGURED IT OUT. I had to do this:

Quaternion minorAxisQuaternion = Quaternion.AngleAxis(rotationDegrees, majorAxisDirection);                                                                                        Vector3 minorAxisVector = Vector3.Cross((minorAxisDirection * Vector3.one), majorAxisDirection);
float b = Mathf.Sqrt(a * a - c * c) / 2f;
Vector3 minorVertex = center + minorAxisVector * b;