Page 1 of 1

Calculation of azimuth

Posted: Fri Jan 06, 2012 7:52 am
by MonieJacobsen
Calculation of azimuth
Calculation implant following C codes

Could somebody please help me implant following C codes into the program Flowcode 4.5 for Picmicro.
It is needed for calculation of azimuth and Alt for controlling of a solar tracker, which together with a GPS (Board EBC056-00-1) and C codes calculates Azimuth and Alt every 5 minutes.
I wish to implant the C codes azimuth east of north and Alt --- altitude above horizon.

See following web-site for C codes:
http://stackoverflow.com/questions/2577 ... d-lat-long

http://www.youtube.com/watch?v=ntILNtq3Y3Y
Kordinater.jpg
Kordinater.jpg (62.22 KiB) Viewed 3311 times
Above shows coordinates and other data which are the basis for the calculations.
Maybe as shown on YouTube insert C codes in ”Supplementary Code”.
Project.jpg
Project.jpg (43.61 KiB) Viewed 3311 times
Output:
az — azimuth east of north
alt — altitude above horizon

As I have no knowlegde of programming with C codes I need some help, please.

Re: Calculation of azimuth

Posted: Fri Jan 06, 2012 10:56 am
by Gary Freegard
Hi Monie

The link you gave is for R code, here is a link with an in depth description and some code http://www.nrel.gov/docs/fy08osti/34302.pdf
One problem with using a Pic for this is that Sin,Cos etc is not a built in function and therefore you will need to calculate it, here are some of the methods discussed on this site. Goodluck

Gary

Re: Calculation of azimuth

Posted: Sat Jan 07, 2012 7:35 am
by MonieJacobsen
Hi Gary
Many thanks for your answer.
Interesting Link.
Has no knowledge of C code, it will be very educational with an example in flow code for PICmicro.
Or is there anyone here on Matrix Multimedia Forums could make a ptogram examples.