Advertisement

Plot Ellipse ***RESOLVED***

Started by June 15, 2003 12:56 AM
8 comments, last by dserkez 21 years, 8 months ago
This is the routine I am running to plot an ellipse: XCENTER=6100 YCENTER=4600 XLEN=60000 YLEN=30000 FOR ANGLE=0 TO 360 XPOS = XCENTER + YLEN * COS(ANGLE) * (PI/180) YPOS = YCENTER + XLEN * SIN(ANGLE) * (PI/180) PLOT(XPOS,YPOS) NEXT ANGLE THIS WILL DRAW AN ELLIPSE WITH ITS MAJOR AXIS (X) ORIENTED 0-180 (NORTH-SOUTH). HOW CAN I PLOT THE SAME ELLIPSE ROTATING THE MAJOR AXIS (CHANGE THE THE X AXIS INCLINATION)? REGARDS DALTON SERKEZ [edited by - DSERKEZ on June 16, 2003 1:06:21 PM] [edited by - DSERKEZ on June 16, 2003 1:07:06 PM]
Original equations
x (q) := xT + xLcos q
y (q) := yT + yLsin q
where C(xT, yT) is the center,
xL, yL are the umm... whadaya call its...
Rotated about C by f radians
x, (q) := xT + xLcos q cos f - yLsin q sin f
y, (q) := yT + xLcos q sin f + yLsin q cos f.

EDIT: Damn fonts!
BTW, quit yellin'! + hasn't this been asked before?

[edited by - GaulerTheGoat on June 15, 2003 3:24:46 AM]
Advertisement
Didn''t mean to be rude, Dalton. I didn''t realize you just signed up. But check the last few weeks worth of posts. Rotation questions are asked every 6 days.

20: ...Qg2 ++
there is big faq on circles and ellips on flipcode.
3D Side-Scroller game demo Project-X2 "playable"Lashkar: A 3D Game & Simulation Project demo @ lashkar.berlios.de
THANKS EVERYONE AND I AM SORRY. I DID SOME FORUM RESEARCH AND HONESTLY I COULD NOT FIND WHAT I WANTED.

I STUDIED YOUR REPPLIES, APPLIED TO MY ROUTINE, MADE SOME CHANGES AND NOW EVERYTHING IS WORKING FINE.

AGAIN, THANKS A MILLION AND SORRY FOR ANY INCONVENIENCE.


REGARDS

DSERKEZ
Quick tip, using all capitals on the Internet is considered the text equivalent of yelling, and is seen by many as very rude.

I don''t think you meant this at all, so no harm done, but in the future you might want to turn off that caps lock key
Advertisement
TO:Anonymous Poster

I LIKE CAPITAL LETTERS... SO WHAT????

ANYTHING WRONG WITH THAT????? GET LOST!!!!

TAKE CARE OF YOUR OWN BUSINESS.

BYE
wow. what a jerk.

[edited by - vanillacoke on June 20, 2003 11:47:51 PM]
You know what I never noticed before?
S.U. GET OUT OF THIS.

[edited by - DSERKEZ on June 20, 2003 11:54:29 PM]
I mean, a complete, total jackass feckhole jerk.
You know what I never noticed before?

This topic is closed to new replies.

Advertisement