How to set boundaries for trigonometric functions
Show older comments
I've written this script to solve for theta values. However, I cant workout how to set boundaries to only get poisitve values for theta, for example 0<theta<360.
clc,clear
syms theta3 theta4
fy = 0 == 73*sind(0) + 92*sind(200) + 87*sind(theta3) + 65*sind(theta4)
fx = 0 == 73*cosd(0) + 92*cosd(200) + 87*cosd(theta3) + 65*cosd(theta4)
[theta3sol,theta4sol] = solve(fy,fx,theta3,theta4)
theta3 = vpa(theta3sol,5)
theta4 = vpa(theta4sol,5)
Returns:
theta3sol =
(360*atan((13*85403789126173195056934905259670212585526538414004209215^(1/2))/212172034776804222801675115885 + 169444851951920877829311430656/212172034776804222801675115885))/pi
-(360*atan((13*85403789126173195056934905259670212585526538414004209215^(1/2))/212172034776804222801675115885 - 169444851951920877829311430656/212172034776804222801675115885))/pi
theta4sol =
(360*atan(85403789126173195056934905259670212585526538414004209215^(1/2)/1009938951550348524254389535 - 1947641976458860664704729088/201987790310069704850877907))/pi
-(360*atan(85403789126173195056934905259670212585526538414004209215^(1/2)/1009938951550348524254389535 + 1947641976458860664704729088/201987790310069704850877907))/pi
theta3 =
107.54
26.165
theta4 =
-52.385
-173.91
How do I make it return only the value from the first solution for both thetas but also in the boundary of 0<theta<360 ?
Any help would be much appreciated.
Answers (0)
Categories
Find more on Genetic Algorithm 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!