## Orientation of ellipsoid

on 13 Jun 2011

### Matt Fig (view profile)

Hello, I am using ellipsoid function to represent an ellipsoid graphically. The input list requires me to enter the coordinates of the centre of ellipsoid and its semi-axes. There is no input for the orientation of the axis of the ellipsoid with respect to the coordinate system. Is there any way, this can be incorporated if my ellipsoids are at angle with respect to x, y and z axis.

## Products

### Matt Fig (view profile)

on 13 Jun 2011

See the help for the ROTATE function.

For example:

```[x, y, z] = ellipsoid(0,0,0,5.9,3.25,3.25,30);
S = surfl(x, y, z);
colormap copper
axis equal
xlabel('X')
ylabel('Y')
zlabel('Z')
rotate(S,[0 0 1],45)
```

Matt Fig

### Matt Fig (view profile)

on 15 Jun 2011

Of course they change.

>> plot_ellipse
>> Z = get(S,'zdata'); % Get the zdata before rotation.
>> rotate(S,[1 1 1],45);
>> Z2 = get(S,'zdata'); % Get the zdata after rotation.
>> isequal(Z,Z2)

ans =

0

Now you can do the same thing with xdata and ydata.

Matt Fig

on 15 Jun 2011

Sakshi

### Sakshi (view profile)

on 15 Jun 2011

Thank you for your time and patience.

### Harsha Vardhan Rao Avunoori (view profile)

Answer by Harsha Vardhan Rao Avunoori

### Harsha Vardhan Rao Avunoori (view profile)

on 13 Jun 2011

You can generate an ellipsoid with the ellipsoid function and while plotting you can use the rotate() suggest by Matt.It should help you.

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi