Solved

Circle Segment

Posted on 1997-08-04
2
397 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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Mydac connection data base issue 3 157
Machine not responding during CopyFile() 3 98
JAudiorecorder record freezing the app 29 67
Tidtcpserver listening on multiports? 1 26
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

776 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