[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

Can someone help me with this code? The equations I wrote are

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 11
Thread images: 1

File: Screenshot_2.png (16KB, 486x424px) Image search: [Google]
Screenshot_2.png
16KB, 486x424px
Can someone help me with this code?

The equations I wrote are in the image

Appear the error:

"unkown type name Calculo"

"too few arguments to function pow"

Calculo de Alfa_min
Calculo de Alfa_max
Calculo de Delta_alfa
alfa = Alfa_min;
while(j<=n_alfa)
{
cos_gama = (Ll*sen(alfa))/(pow((pow((Ll*cos(alfa)-OB),2) + ((pow(Ll,2))*(pow(sen(alfa),2))))),0,5);
sen_gama = (Ll*cos(alfa)-OB)/(pow((pow((Ll*cos(alfa)-OB),2) + ((pow(Ll,2))*(pow(sen(alfa),2))))),0,5);
cos_beta = (OC*sen(alfa))/(pow((pow((OC*cos(alfa)-OA),2) + ((pow(OC,2))*(pow(sen(alfa),2))))),0,5);
sen_beta = (OC*cos(alfa)-OA)/(pow((pow((OC*cos(alfa)-OA),2) + ((pow(OC,2))*(pow(sen(alfa),2))))),0,5);
>>
ps; disregard the "sen", I alread change to "sin"
>>
>>324748
Why do you have ,0,5 at the end of pow?
>>
>>324756
because I thought is the same as 1/2 but isn't
in C I have to write 1.0/2

right?
>>
>>324772
no i meant you have pow(x,0,5)
pow only accepts two arguments. if you're trying to do a square root, it would be 0.5

you should use sqrt instead of raising it to the power of 0.5
>>
>>324779
Thank you very much anon
I did not realize that I could use sqrt in this situation.

But I still with the problem with "too few/many arguments"
probably is something connected with the code's header . I'll try to fix that.

Thanks, again
>>
>>324756

Because Euro-monkeys use commas for the decimal point and period points for spacers.
>>
>>324748
cos_gama =
(Ll*sen(alfa))
/
(
>pow(
>>(
>>>pow(
>>>>(
>>>>>Ll*cos(alfa)-OB
>>>>)
>>>,2)
>>+ (
>>>(
>>>>pow(Ll,2)
>>>)*(
>>>>pow(sen(alfa),2)
>>>)
>>)
>)
),0,5
);

you have an extra )) before the 0.5

>Protip: avoid recomputing the same thing over and over

double ls = Ll*sen(alfa);
double lc_ob=Ll*cos(alfa)-OB;

cos_gama = ls/sqrt(lc_ob*lc_ob + lc_ob*lc_ob);
sen_gama = lc_ob/sqrt(lc_ob*lc_ob + lc_ob*lc_ob);

double ocs=OC*sen(alfa);
double occ_oa=OC*cos(alfa)-OA;

cos_beta = ocs/(pow(occ_oa*occ_oa + ocs*ocs, 0.5);
sen_beta = occ_oa/(pow(occ_oa*occ_oa + ocs*ocs, 0.5);

>>324772
>because I thought is the same as 1/2 but isn't

Because 1 is an int and 2 is an int so 1/2 is integer division that will return an int (0)
>>
>>324904
Thank you very much.
I'm using sqrt now

Can someone explain other thing? I don't want create a new thread.

How can I insert a function in this code?

Look, I have:
Alfamin = PI/D1 <= ALFA
Alfamax = P1/D2 >= ALFA

I have to put a condition:
The first alfa value returned have to be equal PI/D1 and the last value returned have to be equal PI/D2.

And my code is:

Calculo de Alfa_min
Calculo de Alfa_max
Calculo de Delta_alfa
alfa = Alfa_min;


how I do that?
>>
why the hell would you use local naming for a standard function, it is fucking sin not sen
>>
>>325083
>Calculo de Alfa_min
>Calculo de Alfa_max
>Calculo de Delta_alfa

This isn't code, it's what you're supposed to do in the assignment. Are you legit retarded?

double Alfa_min = PI/D1;
double Alfa_max = P1/D2;
double Delta_alfa = (Alfa_max - Alfa_min)/1024; // replace 1024 by how many increments you want

for(alfa = Alfa_min; alfa <= Alfa_max; alfa = alfa + Delta_alfa)
{
...
Thread posts: 11
Thread images: 1


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
All trademarks and copyrights on this page are owned by their respective parties.
Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.