Allegro.cc - Online Community

Allegro.cc Forums » Off-Topic Ordeals » Looking for astrology example program

This thread is locked; no one can reply to it. rss feed Print
Looking for astrology example program
Striker
Member #10,701
February 2009
avatar

Chris Katko
Member #1,881
January 2002
avatar

Which chart, specifically? They all have geometric differences in those pictures.

It doesn't look too hard at first glance. The worst part would be getting the math to center text between the lines.

Are you looking to have a variable number of divisions? For example, this one is:

{"name":"astrology-wheel.gif","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/1\/4\/14dcab44d320af2035eb9a3ec16feda5.gif","w":2064,"h":2070,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/1\/4\/14dcab44d320af2035eb9a3ec16feda5"}astrology-wheel.gif

subdivides at 30/60/90 degree intervals. I mean, all of them are 12-month calendars, obviously. But are you looking for a generic case code?

Another one has much more stuff in it:

{"name":"teachingwheel.jpg","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/5\/f\/5ff53e8572562c69916343289c7ed594.jpg","w":480,"h":480,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/5\/f\/5ff53e8572562c69916343289c7ed594"}teachingwheel.jpg

And wrapped/angled text plus background textures and so on. It's also rotated 15 degrees.

-----sig:
“Programs should be written for people to read, and only incidentally for machines to execute.” - Structure and Interpretation of Computer Programs

Striker
Member #10,701
February 2009
avatar

Thanks for your reply, Chris!

I think i would need a generic case code, as there are a few circles needed:

1. The background diagram with 12 equal divisions, but rotated, so that the ascendant is always at the outer left edge.

2. Signs in right positions.

3. Planet symbols in the inner circle.

4. Aspect lines between the planets.

5. Houses with unequal divisions.

All together it would look like this one:

http://www.astrodreamadvisor.com/How_To_Astrology_Chart.html

8-)

Mark Oates
Member #1,146
March 2001
avatar

What are you wanting to use it for?

Do you just want to generate an image or something more interactive?

Any reason you're wanting to use Allegro and not, say, CSV or something else?

Striker
Member #10,701
February 2009
avatar

What means CSV? Honestly, my english is still not good enough to participate in the discussions here for more than a few simple words. Go and try to discuss in a german programmer forum in german and you will see how difficult it is.

Special features of my program will be to use more Kuiper Belt Objects, planetoids and aspects like quintile and septile.

Mainly i want to create a program for my personal use. And if i would want to sell it, what would be the conditions? (In simple words, please.)

8-)

Mark Oates
Member #1,146
March 2001
avatar

Quote:

CSV

EEeeerrpps! :-X Not CSV, I meant to say SVG.

You can have SVG images in browsers, like PNG. Except with SVG, you can "draw" the image by using HTML or Javascript.

An example: http://www.w3schools.com/svg/svg_inhtml.asp

Striker said:

my english is still not good

Thanks, I'll keep that in mind. :)

Striker
Member #10,701
February 2009
avatar

Maybe a good idea to use SVG, i have thought to save graphics in JPG or GIF before. 8-)

Mark Oates
Member #1,146
March 2001
avatar

If you draw to an HTML <canvas>, you can right-click and save that as a PNG.

Striker
Member #10,701
February 2009
avatar

Here is a part of code i found in Pullens "Astrolog" from here:

http://www.astrolog.org/astrolog/astfile.htm

#SelectExpand
1void DrawWheel(real *xsign, real *xhouse, int cx, int cy, real unitx, 2 real unity, real asc, real r1, real r2, real r3, real r4, real r5) 3{ 4 int i; 5 real px, py, temp; 6 7 /* Draw Ascendant/Descendant and Midheaven/Nadir lines across whole chart. */ 8 9 DrawColor(gi.kiLite); 10 DrawDash(cx+POINT1(unitx, 0.99, PX(xhouse[sAri])), 11 cy+POINT1(unity, 0.99, PY(xhouse[sAri])), 12 cx+POINT1(unitx, 0.99, PX(xhouse[sLib])), 13 cy+POINT1(unity, 0.99, PY(xhouse[sLib])), !gs.fColor); 14 DrawDash(cx+POINT1(unitx, 0.99, PX(xhouse[sCap])), 15 cy+POINT1(unity, 0.99, PY(xhouse[sCap])), 16 cx+POINT1(unitx, 0.99, PX(xhouse[sCan])), 17 cy+POINT1(unity, 0.99, PY(xhouse[sCan])), !gs.fColor); 18 19 /* Draw small five or one degree increments around the zodiac sign ring. */ 20 21 for (i = 0; i < nDegMax; i++) { 22 temp = PZ(HousePlaceInX((real)i)); 23 px = PX(temp); py = PY(temp); 24 DrawColor(i%5 ? gi.kiGray : gi.kiOn); 25 DrawDash(cx+POINT1(unitx, r3, px), cy+POINT1(unity, r3, py), 26 cx+POINT2(unitx, r4, px), cy+POINT2(unity, r4, py), 27 ((!gs.fColor || gs.fPS || gs.fMeta) && i%5)*2); 28 } 29 30 /* Draw circles for the zodiac sign and house rings. */ 31 32 DrawColor(gi.kiOn); 33 DrawCircle(cx, cy, (int)(unitx*0.95+rRound), (int)(unity*0.95+rRound)); 34 DrawCircle(cx, cy, (int)(unitx*r4+rRound), (int)(unity*r4+rRound)); 35 DrawCircle(cx, cy, (int)(unitx*r3+rRound), (int)(unity*r3+rRound)); 36 DrawCircle(cx, cy, (int)(unitx*r1+rRound), (int)(unity*r1+rRound)); 37 38 /* Draw the glyphs for the signs and houses themselves. 39 */ 40 41 for (i = 1; i <= cSign; i++) { 42 temp = xsign[i]; 43 DrawColor(gi.kiOn); 44 DrawLine(cx+POINT2(unitx, 0.95, PX(temp)), /* Draw lines separating */ 45 cy+POINT2(unity, 0.95, PY(temp)), /* each sign and house */ 46 cx+POINT1(unitx, r4, PX(temp)), /* from each other. */ 47 cy+POINT1(unity, r4, PY(temp))); 48 DrawLine(cx+POINT2(unitx, r3, PX(xhouse[i])), 49 cy+POINT2(unity, r3, PY(xhouse[i])), 50 cx+POINT1(unitx, r1, PX(xhouse[i])), 51 cy+POINT1(unity, r1, PY(xhouse[i]))); 52 if (gs.fColor && i%3 != 1) { /* Lines from */ 53 DrawColor(gi.kiGray); /* each house */ 54 DrawDash(cx, cy, cx+POINT2(unitx, r1, PX(xhouse[i])), /* to center */ 55 cy+POINT2(unity, r1, PY(xhouse[i])), 1); /* of wheel. */ 56 } 57 temp = Midpoint(temp, xsign[Mod12(i+1)]); 58 DrawColor(kSignB(i)); 59 DrawSign(i, cx+POINT1(unitx, r5, PX(temp)), 60 cy+POINT1(unity, r5, PY(temp))); 61 temp = Midpoint(xhouse[i], xhouse[Mod12(i+1)]); 62 DrawHouse(i, cx+POINT1(unitx, r2, PX(temp)), 63 cy+POINT1(unity, r2, PY(temp))); 64 } 65} 66 67 68/* Another subprocedure of XChartWheel() and XChartWheelRelation(). Draw */ 69/* a set of planets in a wheel chart, drawing each glyph and a line from */ 70/* it to a dot indicating the planet's actual location. */ 71 72void DrawSymbolRing(real *symbol, real *xplanet, real *dir, int cx, int cy, 73 real unitx, real unity, real r1, real r2, real r3, real r4) 74{ 75 int i; 76 real temp; 77 78 for (i = cObj; i >= 0; i--) if (FProper(i)) { 79 if (gs.fLabel) { 80 temp = symbol[i]; 81 DrawColor(dir[i] < 0.0 ? gi.kiGray : gi.kiOn); 82 DrawDash(cx+POINT1(unitx, r2, PX(xplanet[i])), 83 cy+POINT1(unity, r2, PY(xplanet[i])), 84 cx+POINT1(unitx, r3, PX(temp)), 85 cy+POINT1(unity, r3, PY(temp)), 86 (ret[i] < 0.0 ? 1 : 0) - gs.fColor); 87 DrawObject(i, cx+POINT1(unitx, r4, PX(temp)), 88 cy+POINT1(unity, r4, PY(temp))); 89 } else 90 DrawColor(kObjB[i]); 91 DrawPoint(cx+POINT1(unitx, r1, PX(xplanet[i])), 92 cy+POINT1(unity, r1, PY(xplanet[i]))); 93 } 94}

But after all, the graphics output of this program is not very good, so i decided to do it new with Allegro. 8-)

Go to: