Fuze Arena Logo
  • Forum
  • Creations
    Catalogue Showcase
  • Help

radians()

Purpose

Change the default units for angles

Description

By default all functions that get or return angles use degrees as the unit (360 degrees in a circle). This function allows you to switch to using radians (2 * PI radians in a circle) and back to degrees

Syntax

radians( enable )

Arguments

enable If 1 (true) then the default unit for angles is swictched to radians otherwise it is degrees

Example

// The 2 for loops are equivalent using different units for angles
clear()
centre = { gWidth() / 2, gHeight() / 2 }
radians( true )
for angle = 0 to 2 * pi step 0.017 loop
    col = { random( 101 ) / 100, random( 101 ) / 100, random( 101 ) / 100, 1.0 }
    point = { 600 * cos( angle ) + centre.x, 300 * sin( angle ) + centre.y }
    line( centre, point, col )
    update()
repeat

clear()
sleep( 3 )
radians( 0 )
for angle = 0 to 360 step 1 loop
    col = { random( 101 ) / 100, random( 101 ) / 100, random( 101 ) / 100, 1.0 }
    point = { 600 * cos( angle ) + centre.x, 300 * sin( angle ) + centre.y }
    line( centre, point, col )
    update()
repeat
sleep( 3 )

Associated Commands

acos(), asin(), atan(), atan2(), pi(), sin(), sinCos(), tan()

logo

©2019 FUZE Technologies Ltd. FUZE is a registered trademark of FUZE Technologies Ltd. All rights reserved.

Useful links

  • Fuze Main Site
  • Fuze Arena on Twitter
  • Fuze Arena on Youtube
  • Download Buyer

Contact Information

  • FUZE Technologies Ltd
    15 Clearfields Farm
    Wotton Underwood
    Aylesbury, Buckinghamshire
    ​England, HP18 0RS

  • +44 (0) 1844 239 432

  • contact@fuze.co.uk

© Copyright FUZE Technologies Ltd. All rights reserved.