So I am to create a wedge parts that has an angle theta of 33 I have the angle how do I work out what the X and Y of the wedge needs to be in order for the angle to be thirty?
local theta = 33
local y = --What?
local z = --What?
Look up how to solve a triangle given 2 angles and 1 side (AAS)
local sin, rad = math.sin, math.rad
local A = 33 -- Angle A
local B = 90 -- Angle B
local C = 180 - A - B -- Angle C
local a = 10 -- Y
local c = a * (sin(rad(C)) / sin(rad(A))) -- Z
print(c)
The formulas for solving triangles use radians not degrees and you don’t need a right triangle one you already have two angles and a side (90 degrees, 33 degrees, and 10 units)
And also maybe they might be testing their code in an online calculator like Desmos, where pasting directly into the input boxes would be beneficial for debugging.
(I do this when working with math in my code to make sure it is correct)
local theta = math.rad(33) --Converts 33 degrees to radians
local y = math.sin(theta)
local z = math.cos(theta)
Wedge.Size = Vector3.new(1,y,z) --Hypotenuse will be of length 1
You can also multiply the size by a scalar if you desire. For example:
local s = 1/z
Wedge.Size = s * Vector3.new(1,y,z) --Z will be of length 1
Thank you, I did know how to do all this once but I have been wrapped up in many other things and have not done any trig in over a year. I am still trying to learn calculus right now.