I got a function from internet that I need to embed in my app code, but the function is not clear.

Function:

* RA = arctan2(cos(e) sin(L), cos(L))/ 15**

Question:

What is the purpose of **,** between Sin and Cos of L?

I got a function from internet that I need to embed in my app code, but the function is not clear.

Function:

* RA = arctan2(cos(e) sin(L), cos(L))/ 15**

Question:

What is the purpose of **,** between Sin and Cos of L?

1 Like

Show the source (link) for the equation, and its intended application.

Check the math drawer, you will find the atan2 block, you will know why.

1 Like

Here is the link of the page:

Prayer Time Calculation Page

You may search for the text

*RA = arctan2(cos(e)* sin(L), cos(L))/ 15*

on the web page.

Intended Purpose:

It is a variable used in calculation of **Equation of Time**

1 Like

The comma ( , ) is used to separate two parameters in this case.

For a method, `m(var a, var b)`

Comma is a punctuator that separates two parameters (input variables).

Thanks for the quick answer, Now which one will be input **Y** and which one will be **X**? Does order maters or not?

1 Like

Read what is written in the image below.

Ref : http://ai2.appinventor.mit.edu/reference/blocks/math.html#atan

1 Like

In function order maters.

1 Like

It would be `cos(e) * sin(L)`

by the way...

I doubt it, should it not be reversed?

1 Like

I think you can veryfy using the sample data provided in

as

d = jd - 2451545.0; // jd is the given Julian date

g = 357.529 + 0.98560028* d;

q = 280.459 + 0.98564736* d;

L = q + 1.915* sin(g) + 0.020* sin(2*g);

R = 1.00014 - 0.01671* cos(g) - 0.00014* cos(2*g);
e = 23.439 - 0.00000036* d;

RA = arctan2(cos(e)* sin(L), cos(L))/ 15;

D = arcsin(sin(e)* sin(L)); // declination of the Sun

EqT = q/15 - RA; // equation of time

you are to provide data according to AI2 function

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.