D2G: Difference between revisions

From QB64 Phoenix Edition Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
 
(6 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{DISPLAYTITLE:_D2G}}
{{DISPLAYTITLE:_D2G}}
The [[_D2G]] function converts a '''degree''' value into a '''gradient''' value.  
The [[_D2G]] function converts a '''degree''' value into a '''gradient''' value.




Line 8: Line 8:


{{PageAvailability}}
{{PageAvailability}}
* '''QB64 1.0 and up''' (QB64 Team)
* '''QB64 v1.0 and up'''
* '''QBPE 0.5 and up''' (QB64 Phoenix Edition)
* '''QB64-PE all versions'''




Line 15: Line 15:
''Example:'' Coverting Degrees into Gradient.
''Example:'' Coverting Degrees into Gradient.
{{CodeStart}}
{{CodeStart}}
INPUT "Give me an angle in Degrees ", D
{{Cl|INPUT}} {{Text|<nowiki>"Give me an angle in Degrees "</nowiki>|#FFB100}}, D
R = _D2G(D)
G = {{Cl|_D2G}}(D)
PRINT "That angle in Gradient is "; R
{{Cl|PRINT}} {{Text|<nowiki>"That angle in Gradient is "</nowiki>|#FFB100}}; G
{{CodeEnd}}
{{CodeEnd}}
{{OutputStart}}
{{OutputStart}}
Line 29: Line 29:
* [[_G2D]], [[_G2R]]
* [[_G2D]], [[_G2R]]
* [[_R2D]], [[_R2G]]
* [[_R2D]], [[_R2G]]




{{PageNavigation}}
{{PageNavigation}}

Latest revision as of 12:53, 29 March 2023

The _D2G function converts a degree value into a gradient value.


Syntax

result = _D2G(num)


Availability

  • QB64 v1.0 and up
  • QB64-PE all versions


Examples

Example: Coverting Degrees into Gradient.

INPUT "Give me an angle in Degrees ", D
G = _D2G(D)
PRINT "That angle in Gradient is "; G
Give me an angle in Degrees 60
That angle in Gradient is  66.66666


See also



Navigation:
Main Page with Articles and Tutorials
Keyword Reference - Alphabetical
Keyword Reference - By usage
Report a broken link