Page 1 of 1

coupla more questions if you guys don't mind...... thanks

Posted: Wed Jun 11, 2008 1:06 am
by smudge
I have a few things figured out now...just having trouble with these questions... ANY help you can provide is greatly appreciated. thanks liz


1) The statements: 100 VIEW (0,0) ? (100,100)
110 WINDOW (100,100) ? (150,150) would associate the physical coordinates (100,100) with the world coordinates ANSWER (150,100) - WHY??????

2) A viewport has been created whose corners are at 920,10), (16,10) (60,50) and (20,50). The statement that assigns the world coordinates (1,0) to the lower left corner and (10,100) to the upper right corners is ? ANSWER: WINDOW (1,0) ? (10,100)???

What is the difference between world and physical coordinates?


100 SCREEN 1,0 : CLS : KEY OFF : COLOR 1,0
120 DIM ARRAY .OF. PIXELS (114)
130 LINE (0,0) ? (40,40), 3, BF
140 GET (1,)) ? (40,40), ARRAY .OF. PIXELS

3) The instruction in line 130 will draw a A FILLED RECTANGLE 41 PIXELS WIDE AND 11 PIXELS HIGH ? WHY?????

4) The instruction in line 140 WILL STORE THE PIXELS OF THE RECTANGLE IN AN ARRAY ? WHY???

5) If the following lines were added: (TO ABOVE STATEMENT):

150 PUT (0,0), ARRAY OF PIXELS
160 PUT (10,10) ARRAY OF PIXELS

The program would MOVE THE SAME RECTANGLE DOWN AND TO THE RIGHT ? WHY??????

6) To draw a semicircle of radius 10 with coordinate (60,60) as the center, you would use the statements 110 CF = 2 * PI/360 ? ANSWER - 120 CIRCLE (60,60),10,CF*180,CF*360 WHY?


7) 20 CLS: KEY OFF
30 COLOR 1,0
40 LINE (20,20) ? (40,40) B
50 CIRCLE (30,30),1,3
60 PAINT (32,32),1,3
70 PAINT (22,22),2,3


8) Line 50 would draw a circle with a ANSWER: 5 PIXEL RADIUS INSIDE OF THE BOX ??
WHY IS THIS CIRCLE ONLY 5 PIXELS? WHERE DID THIS FIGURE COME FROM????

any help you can give me would be great. thanks liz

Posted: Wed Jun 11, 2008 1:30 am
by burger2227
The viewable area is the world and the object may go beyond that area.

If the window area is smaller than the total object, portions will be out of view. Try expanding the view area to see more of an object.

Ted

Posted: Wed Jun 11, 2008 7:38 am
by smudge
thanks so much burger! i really appreciate the help.

Why is the circle drawn only 5 pixels? - thanks liz

Posted: Wed Jun 11, 2008 9:45 am
by MystikShadows
Because the last parameter of the CIRCLE statement here is 3 which means a radius of 3 pixels starting from the middle pixel gives a diameter of 5 pixels.

Posted: Wed Jun 11, 2008 11:25 am
by burger2227
As to the number of pixel counts, write the series 0 to 10. You can then count the numbers and you end up with 11.

In your mind, you try to subtract 0 from 10 and get 10. Always add 1 if you use subtraction first. Just like QB code (whatever that is) would do it.

boxpixels = (40 - 0) + 1 returns the actual number of pixels from 0 to 40.

Ted

Posted: Wed Jun 11, 2008 2:26 pm
by smudge
thanks so much guys!!!!!! you are really helpful.

-liz