Page 1 of 1

Diameter of a circle

Posted: Thu Apr 21, 2016 10:13 am
by kevin007
Hi ALL

How to find the diameter of a circle when I click a button, which was created by the below code.

Code: Select all

set the style of templategraphic to "oval"
choose graphic tool

Actually, i need the value in cm if i know width and height of circle

Thanks
Kevin

Re: Diameter of a circle

Posted: Thu Apr 21, 2016 11:21 am
by Klaus
I ususally create a little function for these kind of tasks, simply pass the name of your graphic to that function:

Code: Select all

function diameter_of_circle name_of_graphic
   return the height of grc name_of_graphic
end diameter_of_circle
This will work, too:

Code: Select all

function diameter_of_circle name_of_graphic
   return the width of grc name_of_graphic
end diameter_of_circle
8)

The PIXEL to CM conversion depends on the dimensions of your pixels = pixel density of your monitor.

Re: Diameter of a circle

Posted: Thu Apr 21, 2016 11:50 am
by kevin007
Hi,

if the 200 is the height of circle,

Is there any formula to convert it into cm,

How can i know the pixel density of my monitor by lc.

Thanks
kevin

Re: Diameter of a circle

Posted: Thu Apr 21, 2016 11:56 am
by Klaus
kevin007 wrote:How can i know the pixel density of my monitor by lc.
You can't!

Maybe it is in the manual of your monitor model, but this will be different for any other montior.
Mostly the density is measured in ppi = pixel per inch, where inch = 2.54 cm.

P.S.
Please take a look at your other postings from time to time, most of them have been answered! 8)

Re: Diameter of a circle

Posted: Thu Apr 21, 2016 12:54 pm
by kevin007
Hi,

How draw a perfect circle by graphically instead of oval ?

Thanks
Kevin

Re: Diameter of a circle

Posted: Thu Apr 21, 2016 1:34 pm
by Klaus
Hold the SHIFT-key when dragging the oval bigger or smaller!

Re: Diameter of a circle

Posted: Thu Apr 21, 2016 3:32 pm
by dunbarx
@Klaus.

Option key, no?

@Kevin.

You can create an oval graphic, and then just set the height equal to the width, no?

Craig Newman

Re: Diameter of a circle

Posted: Thu Apr 21, 2016 3:57 pm
by Klaus
Hi Craig,
dunbarx wrote:@Klaus.
Option key, no?
Ah, yes, sorry! SHIFT-key will keep the initial aspect ratio of an object while resizing.
However this will be the same for a newly crreated oval graphic, which is in fact a circle. :D


Best

Klaus