1
I need to create a solution for a client of a web application that produces calculations of the position of the planets.
I was indicated to use this library swedll32.dll , and did some tests and works very well in Delphi 7.
The problem is that I need to publish in a web application and I’m not getting it to work. I tried using . net
What solution do I need:
A web application (any language) that accesses this dll and makes the calculations
A hosting option for this application
For more details of the application follow links of example codes and documentation.
http://www.astro.com/swisseph/swephinfo_e.htm
http://www.astro.com/ftp/swisseph/programs/
I’ll put an excerpt of code on very simple Delphi to understand what I need.
Most grateful =)
function swe_julday(year : integer;
month : integer;
day : integer;
hour : double;
gregflag : integer
) : double; stdcall; far; external 'swedll32.dll' name '_swe_julday@24';
function swe_calc(tjd : double; {Julian day number}
ipl : Integer; {planet number}
iflag : Longint; {flag bits}
var xx : double; {first of 6 doubles}
sErr : PChar {Error-String}
): Longint; stdcall; far; external 'swedll32.dll' name '_swe_calc@24';
function PegaPosicaoDoPlaneta() : string;
var
tjd,
dhour,
tjdet : double;
planet_number : integer
iday, imonth, iyear : integer;
iflag, rflag : Longint;
xx : Array[0..5] of double;
serr : Array[0..255] of Char;
sjul: String[30];
resultado : string;
begin
iday := 1;
imonth := 1;
iyear := 2016;
ihour := 11;
imin := 59;
isec := 00;
dhour := ihour + imin / 60.0 + isec / 3600.0;
tjd := swe_julday(iyear, imonth, iday, dhour, 1);
planet_number := 0;
iflag := 0;
rflag := swe_calc(tjd, planet_number, iflag, xx[0], serr);
Str(xx[0]:16:10, sjul);
resultado := 'Planeta ' + IntToStr(planet_number) + ' na posicao = ' + sjul;
result := resultado;
end;
I found his source code in C: http://www.astro.com/ftp/swisseph/src/ - However, it is a very complex code and difficult to understand.
– Victor Stafusa