Solved

Circle Segment

Posted on 1997-08-04
2
387 Views
Last Modified: 2010-04-04
I have a drawn a circle and i want to draw a line from the middlepoint of the circle given the angle to the end of the circle (like a speedmeter). I use the following formula but can't get it working...Ellipse(0, 0, Radius, Radius);X := round(cos(PI * Angle / 180) * Radius / 2);Y := round(sin(PI * Angle / 180) * Radius / 2);MoveTo( round(Radius / 2), round(Radius / 2));LineTo( X, Y);with regards, Ronald
0
Comment
Question by:rvaken
2 Comments
 
LVL 3

Accepted Solution

by:
mirek071497 earned 50 total points
ID: 1340484
You must change calculate for X and Y.

X := round(cos(PI * Angle / 180) * Radius / 2 + Radius/2);
Y := round(sin(PI * Angle / 180) * Radius / 2+ Radius/2);

This is because Ellipse( x1,y1,x2,y2 ) draw ellipse bounded on rectangle. (not Ellipse( x1,y1,r1,r2) !!! );


0
 

Author Comment

by:rvaken
ID: 1340485
Thanks, mirek... I lost the clue's... Couldn't see the prob anymore... :)
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
This video discusses moving either the default database or any database to a new volume.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now