How to plot trajectory of angles at varying x, y, and z position
Show older comments
Hello,
I want to plot trajectory of angles theta1, theta2, and theta3 vary depending on xyz position in 2D or 3D.
I got the theta1,2 and 3 functions having x, y, and z variables from the last 3 lines at the bottom of the code.
I would appreciate your help.
function [theta1, theta2, theta3] = trajectory(x,y,z)
syms theta1 theta2 theta3 x y z
L = 0.7;
l = 1.3;
wb = 0.2;
sp = 0.08;
wp = 0.02;
up = 0.05;
a = wb - up;
b = sp/2 - (sqrt(3)/2)*wb;
c = wp - wb/2;
eqn1 = 2*L*(y+a)*cos(theta1) + 2*z*L*sin(theta1) + x^2 + y^2 + z^2 + a^2 + L^2 + 2*y*a - l^2 == 0
eqn2 = -L*(sqrt(3)*(x+b)+y+c)*cos(theta2) + 2*z*L*sin(theta2) + x^2 + y^2 + z^2 + b^2 + c^2 + L^2 + 2*x*b + 2*y*c - l^2 == 0
eqn3 = L*(sqrt(3)*(x-b)-y-c)*cos(theta3) + 2*z*L*sin(theta3) + x^2 + y^2 + z^2 + b^2 + c^2 + L^2 - 2*x*b + 2*y*c - l^2 == 0
theta1=solve(eqn1,theta1)
theta2=solve(eqn2,theta2)
theta3=solve(eqn3,theta3)
theta1 = theta1(2)
theta2 = theta2(2)
theta3 = theta3(2)
Accepted Answer
More Answers (0)
Categories
Find more on Polar Plots in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!