Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Circle as approx of lines & Viewport Mapping
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  1 message - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
SJ  
View profile  
 More options Sep 5 2011, 1:08 am
Newsgroups: comp.graphics.misc
From: SJ <s...@sj.com>
Date: Mon, 05 Sep 2011 10:38:10 +0530
Local: Mon, Sep 5 2011 1:08 am
Subject: Circle as approx of lines & Viewport Mapping
I doing a computer graphics course. Till now we have been taught
Bresenham Algorithms, Midpoint Algorithms, 2-d & 3-d
transformations, window/viewport mapping.

I am currently looking at some questions/problems.

This is one of the problems.

"A circle of radius 25 mm, centered at (100, 150), is to be drawn as a
series of lines by 2-d drafting system. The max. tolerance is 1 mm.
Cacluate the numbers of lines required to display the circle within
this tolerance, and calculate the screen coordinates of
the first of the lines. The window bounds are (40, 100) and (160, 200),
and the viewport bound are at pixel locations (0, 50), (480, 450)".

We haven't done drawing circle as series of lines, but I just tried
to solve this problem using basic geometry.

I have uploaded a rough drawing which I used to calculate this at
http://www.flickr.com/photos/66943862@N06/6110850003/

For maximum tolerance of 1 mm, the maximum length of OB is
25 - 1 = 24.
OP is 25 (radius)

Let angle POB be x

cos(x) = OP/OB = 24/25

so x = cosinv(24/25) = 16.26 degrees.

So angle AOB = 2 * 15.95 = 32.52 degrees.

number of lines = 360/32.52 = 11.07

To round this, we can chose either 11 or 12.
If we chose 11, the display tolerance would be a little
more than 1 mm. Hence we chose 12.
So we need to draw the circle as 12 lines.

Is this right way to do this? Or is this some separate
topic in Computer Graphics which I haven't covered. If
so can someone give me the name of the topic which I can
search for?

Also, I am not sure what it means by "first of the lines".

If I have 12 lines, I will have 3 lines in each quadrant.
I calculated the screen co-ordinates of the 3 lines in the
first quadrant in the following way. Is this the right way?

In the world co-ordinates, if I assume the first line to start
at the point whether the y axis intersects the circle above the
x-axis. This point would be (100, 175). The next 3 points going
clockwise would be (112.5, 175.35), (121.65. 162.5) & (125, 150)

My Transformation Matrix for converting this into screen co-ordinates
would be derived as follows

T(0,50). S(4,4). T(-40,-100).

Using this on the 4 points gives me screen co-ordinates as
(240, 350), (295, 335.4), 326.6, 300), (340, 250)

Is this the right way to do this?


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »