[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Home]
/agdg/ here. Basically im new to maths and...
Images are sometimes not shown due to bandwidth/network limitations. Refreshing the page usually helps.

You are currently reading a thread in /sci/ - Science & Math

File: thing.png (7 KB, 383x382) Image search: [iqdb] [SauceNao] [Google]
7 KB, 383x382
/agdg/ here. Basically im new to maths and am trying to figure out how to crop x y coordinate input values inside a circle value. So basically what mathematical wizardry do I need to calculate the length of y and x?
>>
Trigonometry.
>>
>>7764473
this desu
>>
>>7764473

OK please can you answer the pic so I understand what to do? I've been stuck on this problem for a long time. I just want to crop controller xy inputs inside a circle.
>>
sin(30) = x/5
x = 5sin(30) = 5/2

(5/2)^2 + y^2 = 5^2
y = sqrt(25 - 25/4) = sqrt(75/4) = 5sqrt(3)/2
>>
>>7764483
https://www.wolframalpha.com/examples/Math.html
>>
Your drawing is incorrect. The angle must be 45° since the line goes to the corner of the square. Even if it doesn't go exactly to the corner, that's nowhere near 30°.
>>
>>7764483
1/?

A triangle and 3 angles (let's call them a, b and c)

The sum of all these angles is always 180 (degrees, but I can't find the circle thingy right now on my keyboard), so a+b+c=180

Given two angles a and b, you can always solve for the third by algebraic manipulations c= 180 - a - b. So given two angles, we can always uniqely determine the third.

A right triangle is a triangle where one angle is 90, so c=90. From the above it follows that we only need one more angle to uniqely determine the third one.

Triangles which have the same angles are called "same". These same triangles always look kinda the same (hence the name) only one is maybe sized up and one is sized down, i.e a smaller version of the original. However no matter what size same triangles have, the ratios of their sides (let's call the three sides x,y and z) are always the same. This is maybe not obvious intuitively, and I won't give a proof of it here, but maybe this explanation might help: Assume you have a triangle with angles a,b,c and sides x,y,z. Now you stretch one side (let's take x) by a factor of 5. We want the resulting triangle ot be same, i.e the angles shouldn't change, so we also have to stretch the sides y and z by the same factor. Now let's look at the ratios of the sides: Take for example the ratio x/z of the first triangle. After stretching the sides, the ratio turns into (5*x )/ (5*z), and from this fraction we can take out the 5's like this 5/5 * x/z = 1 * x/z = x/z. So we see that stretching does nothing to the ratios and we can conclude that

THE RATIOS OF THE SIDES IN A TRIANGLE ARE EQUAL FOR ALL SAME TRIANGLES.
>>
>>7764467
The hypothenuse of the triangle is the radius of the circle. Let that be $r$,

y is the adjacent line, relative to your angle $\Theta$

By the trivial rules of trigonometry (SOHCAHTOA)
$y = \cos(\theta)r$

and for x, which is the opposite line

$x =\sin(\theta)r$

This is high school math man.
>>
File: sin.png (22 KB, 1000x1551) Image search: [iqdb] [SauceNao] [Google]
22 KB, 1000x1551
>>7764534
2/?

Okay, now let's get back to right triangles. We already found out that the angles of a right triangle are uniqely defined by just giving a single angle. So for each angle we can define the ratios of the sides and those ratios will be equal for all same triangles (again, right triangles with the same angle a)

Now let's look at the picture:
We call the ratio of the side opposite to the angle a to the long side the sine of a : sin(a) = y/z
We call the ratio of the side adjacent to the angle a to the long side the cosine of a : cos(a) = x/z
We call the ratio of the opposite side to the angle to the adjacent angle the tangens of a: tan(a) = y/x

Okay, now we have done a lot of work to name a bunch of ratios, but what's the use of it.? Presume someone put in a lot of effort and calculated the numerical values of the sine and cosine and tanges for many different values of a (remember that we can do that since the ratios are the same for all same right triangles and the triangle is uniquely determine by a single angle). So we now for example sin(45) or cos(39) or even tan(188).

Also presume that the length of z is unknown to us and we want to find it. By the above equations we can do algebraic manipulation of the first one and find that z = y/(sin(a)). Or we could calculate z by the second equation and we'd find z = x/(cos(a)). So this is a very useful tool to calculate the lenghts of a right triangle if you just know the angle and one side. I'll leave it to you to find out how to calculate x and y if you know just the angle a and z (as in your problem).
>>
File: unit_circle.png (7 KB, 335x296) Image search: [iqdb] [SauceNao] [Google]
7 KB, 335x296
>>7764561
3/3

One last thing: A very useful guide to remember these trigonometric relations is the unit circle (see pic). Here a right triangle is inscribed in a circle of radius r=1. But because the long side z IS the radius of the circle, we know that z=1. But then the equations above reduce to

sin(a) = y
cos(a)=x
tan(a) = y/x

So the values of sine and cosine are just the lengths of the short sides.

This is very useful to think about these things and you should play around with it a bit to properly understand it.
>>
5
>>
>>7764467

r * cis(θ) = y + ix

solve from there
>>
>>7764467
>tfw this isn't bait