Question: clear; clc; 8Define a 3D vector starting at the origin A = 13,1,41'; *Plot the vector in 3D plot30 A(1)],[0 A(2),[0 A(3)]); axis equal; grid
![= 13,1,41'; *Plot the vector in 3D plot30 A(1)],[0 A(2),[0 A(3)]); axis](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/09/66f453b8d2c81_24866f453b871a02.jpg)
clear; clc; 8Define a 3D vector starting at the origin A = 13,1,41'; *Plot the vector in 3D plot30 A(1)],[0 A(2),[0 A(3)]); axis equal; grid on; text(1.5,.5,2,'\leftarrow A) Define some rotations - remember to use radians for all calculations psi- theta - + phi = Define the rotation matrices Rpsi - 3 Rtheta = Rphi - Part 1: Write a Matlab script that rotates a 3D vector along the psi, theta and phi axis Here's a template to get you started: Lab_2_template.m Does it matter in which order the rotations are done? Why or why not? Test with at least 3 different 3D vectors and different combinations of rotation orders. Make sure you plot the vectors and annotate the order of rotation and it's direction Part 2: Generate a function that generates a Rotation Matrix Provide phi, theta and psi as inputs Test your function by rotating 3D vectors (at least 2) and plot them How do you know that your answers are correct? Describe your rationalization. Part 3: Implement your knowledge An aircraft is at point p (pn = 100, pe = 50, pd = -20) and moves forward with u = 8 m/s, v = 0 m/s and w=-1 m/s while its roll, pitch and yaw remains constant at 0 = 0 ,0 = 6', y = 120". After 2 seconds, where did it end up? o hints: . u, V and w are in the body frame of the UAS Rotate from the body frame to the vehicle frame . Pi = po + idt Now, add some wind (make up some numbers for wn, we, W.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
