Use of inches in the Canvas

Hello,

I working on a project to simulate an arm swinging (ex. pendulum) but want to se the actual dimensions of an arm. For example 27 inches in length. How can I actually get the length when the canvas is in pixels?

Thanks…

Hello,

For this, you will need to know the real world dimension of your screen (the display area) and its resolution (Number of pixels for the width and height).

Based on those informations, you can get the real world size of a pixel and use that to draw what you want based on the real world size.

Of course you will need to calculate those values every time you are changing your screen.

If you want to automate it with code, you can have a look at this: https://docs.oracle.com/javase/6/docs/api/java/awt/Toolkit.html#getScreenResolution()

Hello,

Wikipedia reference:

You may also want to confirm your display measurements (measure) against the specs of your display.

:)