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.
52 messages · Page 1 of 1 (latest)
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.
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.
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
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
sorry, i'm still stuck on it
on what part?
it needs to look something like this
Okay...
Your code is wrong, can't get nothing else from that picture
should be more than enough information to solve the task
"#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 :((
#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.
i've never worked with theta in C programming before, so this is a first for me
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, ...
yeah, ik
Dude. This has nothing to do with programming. This is purely trigonometry
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.
it's not homework, it's just an exercise
Figure out the math and think about programming afterwards
You mentioned your
idiot lecturer barely covered it in depth
what is it that u r trying to say then?
i'm done, i've solved it....
thanks for nothing, #include_ _ DATE _ _
@tawdry basin
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.
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
he got annoyed
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
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
You have been provided on multiple occasions paths to help you solve your problem. What we will not do is solve it for you
That was mentioned aswell in the assignment:
180 degrees = pi
360 degrees = 2pi
oh, he deleted it by now
yes i just converted it
yeah
yeah i was wondering what you were referencing lol
well that assignment was easy
nah you just pro gamer
Indeed
Sounded more like an answer request than anything else
Well, to you, not me. I just wanted someone to explain it in simpler terms that would make it slightly easier to understand when i literally just started this topic. Please do not go off and make assumptions.