< Futurebasic < Language < Reference

Syntax

RATIO h,v

Description

This statement affects the width and height of shapes subsequently drawn with the CIRCLE statement. By suitably setting the h and v parameters, you can draw ellipses with any aspect ratio. Each of h and v can range in value from -128 to +127. The h parameter affects the width of the ellipse, and the v parameter affects its height. When you subsequently execute a CIRCLE statement with a radius parameter of radius, a circle or ellipse is drawn which has these dimensions: Shape's width = 2 * radius * (1 + h /128) Shape's height = 2 * radius * (1 + v /128) We can notice a few consequences of these formulas: If h and v are equal, a circle is drawn. If h and v are different, an ellipse is drawn. If h > v, the ellipse is wider than it is tall. If v > h, the ellipse is taller than it is wide. Negative values of h or v cause the corresponding dimension to shrink. Positive values cause the corresponding dimension to grow (up to about twice its original size). Specifying RATIO 0,0 "resets" the ratios: subsequent CIRCLE statements will draw a circle with the indicated radius. After you execute a RATIO statement, the indicated h and v values remain in effect for all subsequent CIRCLE statements (in all windows), until another RATIO statement is executed.

See Also

CIRCLE

This article is issued from Wikibooks. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.