confused on how to code this

1 次查看(过去 30 天)
Brendan Jozwiak
Brendan Jozwiak 2022-8-25
(a) Create a variable named theta. Assign an angle of to it.
Prove the trigonometric identity sin^2(theta)+cos^2(theta)=1
Here the is the variable ‘theta’ you created.
(b) Convert theta into degrees and store in a new variable theta_d and then repeat (a) to prove the trigonometric identity again. (Do not use function deg2rad).
  4 个评论
Chunru
Chunru 2022-8-26
theta = pi/2 instead of theta=angle(pi/2). Angle is a function to find the phase angle of a complex number. For a real number pi/2, the "angle" is 0.

请先登录,再进行评论。

回答(2 个)

Walter Roberson
Walter Roberson 2022-8-25
编辑:Image Analyst 2022-8-26
Use sin(theta)^2
360 degrees = 2π radians
divide by 2π
360/(2π) degrees = 1 radian
so x radians = 360/(2π) * x degrees
In matlab π is pi

Image Analyst
Image Analyst 2022-8-26
To convert theta into degrees
theta_d = theta * 180 / pi
To use trig functions on degrees, use the "d" version, for example sind instead of sin
sind(theta_d) ^ 2

类别

Help CenterFile Exchange 中查找有关 Special Functions 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by