#Trigonometry Solver

52 messages · Page 1 of 1 (latest)

analog badgeBOT
#

When your question is answered use !solved to mark the question as resolved.

Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question run !howto ask.

shrewd whale
#

Nowhere in your code can I see the section for You will need to convert the user's input of degrees into radians before using the sine and consine functions.

#

Not to mention that in the assignment he told you everything you need to know about sin and cos to solve this task.

tawdry basin
#

yeah, i have never come across this question before, so it came as a shock

#

especially with math.h, i'm learning it for the first time

shrewd whale
#

I mean you get Theta and the value for the hypotenuse, so all you need to do is transform the two equations
sin(Theta) = opposite / hypotenuse to opposite = sin(Theta) * hypotenuse which you can now easily solve. Analogue for adjacent

shrewd whale
#

on what part?

tawdry basin
shrewd whale
#

Okay...
Your code is wrong, can't get nothing else from that picture

#

should be more than enough information to solve the task

tawdry basin
# shrewd whale Okay... Your code is wrong, can't get nothing else from that picture

"#include <stdio.h>
#include <math.h>

int main(void)
{
float angle_degrees = 0.0f;
float hypotenuse_length = 0.0f;
double sine;
double cosine;

printf("What is the angle in degrees\? ");
scanf("%f", &angle_degrees);

printf("What is the length of the hypotenuse\? ");
scanf("%f", &hypotenuse_length);

sine = sin(angle_degrees / hypotenuse_length);
cosine = cos(angle_degrees / hypotenuse_length);

printf("\nThe length of the opposite is: %.6f\n", sine);
printf("The length of the adjacent is: %.6f", cosine);

return 0;

}"

Everything above the second scanf is right, but the variables arent correct :((

shrewd whale
#
#include <stdio.h>
#include <math.h>

int main(void)
{
    float angle_degrees = 0.0f;
    float hypotenuse_length = 0.0f;
    double sine;
    double cosine;

    printf("What is the angle in degrees? ");
    scanf("%f", &angle_degrees);

    printf("What is the length of the hypotenuse? ");
    scanf("%f", &hypotenuse_length);

    sine = sin(angle_degrees / hypotenuse_length);
    cosine = cos(angle_degrees / hypotenuse_length);

    printf("\nThe length of the opposite is: %.6f\n", sine);
    printf("The length of the adjacent is: %.6f", cosine);

    return 0;
}
#

Everything above the scanf is correct because there is nothing you do.

tawdry basin
#

i've never worked with theta in C programming before, so this is a first for me

shrewd whale
#

Everything after the scanfs is completely wrong

#

Theta is just a letter

#

A greek letter

#

It's just a variable like f.e. x, n, a, ...

tawdry basin
tough harness
analog badgeBOT
#
#include __DATE__
We Don't Do Your Homework

Welcome to Together C & C++ 👋

We won't do your homework for you (#rules) but we are happy to help you learn and point you in the right
direction.

Please send what you have so far and ask a specific question.

tawdry basin
tough harness
#

Figure out the math and think about programming afterwards

tough harness
tawdry basin
#

i'm done, i've solved it....

#

thanks for nothing, #include_ _ DATE _ _

analog badgeBOT
#

@tawdry basin

Please Do Not Delete Posts!

Please don't delete forum posts. They can be helpful to refer to later and other members can learn from them. You can use !solved to close a post and mark it as solved.

mild mortar
#

think you need to break the problem into smaller parts. first you need to understand that the trigonometric functions in c, like most other languages use angles in radians to do calculations

zenith hamlet
#

he got annoyed

mild mortar
#

hm yeah im not sure if they're saying that that they have solved the issue in their head or if they have a working program now

zenith hamlet
#

like i have notes about that thing

#

if that can help you @tawdry basin

#

a radian is an measurement of circle or specifically an arc

#

well you need to understnad radian thing for that

#

you need to translate between original degree and c lang radians

#

like

#

1 degree = 0.0174532925 radian

tough harness
shrewd whale
#

oh, he deleted it by now

zenith hamlet
#

yeah

mild mortar
#

yeah i was wondering what you were referencing lol

zenith hamlet
#

well that assignment was easy

mild mortar
#

nah you just pro gamer

tough harness
#

Sounded more like an answer request than anything else

zenith hamlet
#

well good night 😴

tawdry basin