Difference between revisions of "Angle16Deg"

From Lazarus wiki
Jump to navigationJump to search
(Created page with "{{Angle16Deg}} The one angle16deg is 1/16th of a degree. For example, a full circle equals 5760 (= 16*360). == function Angle16DegToRad == Convert Angle16Deg to [[Radian|r...")
 
Line 7: Line 7:
  
 
Convert Angle16Deg to [[Radian|radian]]
 
Convert Angle16Deg to [[Radian|radian]]
 +
 +
<syntaxhighlight>
  
 
function Angle16DegToRad(const a_angle16deg:integer):double;
 
function Angle16DegToRad(const a_angle16deg:integer):double;
Line 12: Line 14:
 
   result := a_angle16deg * Pi * 16 / 180;
 
   result := a_angle16deg * Pi * 16 / 180;
 
end;
 
end;
 +
 +
</syntaxhighlight>
  
 
== function RadtoAngle16Deg ==
 
== function RadtoAngle16Deg ==
  
 
Convert radian to Angle16Deg
 
Convert radian to Angle16Deg
 +
 +
<syntaxhighlight>
  
 
function RadtoAngle16Deg(const a_radian:double):integer;
 
function RadtoAngle16Deg(const a_radian:double):integer;
Line 21: Line 27:
 
   result := round ( a_radian * 180 * 16 / Pi );
 
   result := round ( a_radian * 180 * 16 / Pi );
 
end;   
 
end;   
 +
 +
</syntaxhighlight>
  
 
== See also ==
 
== See also ==
 
* [[Radian]]
 
* [[Radian]]
 
* [[doc:lcl/graphics/tcanvas.chord.html|Chord]]
 
* [[doc:lcl/graphics/tcanvas.chord.html|Chord]]

Revision as of 21:51, 27 October 2015

English (en) français (fr)

The one angle16deg is 1/16th of a degree. For example, a full circle equals 5760 (= 16*360).

function Angle16DegToRad

Convert Angle16Deg to radian

function Angle16DegToRad(const a_angle16deg:integer):double;
begin
  result := a_angle16deg * Pi * 16 / 180;
end;

function RadtoAngle16Deg

Convert radian to Angle16Deg

function RadtoAngle16Deg(const a_radian:double):integer;
begin
  result := round ( a_radian * 180 * 16 / Pi );
end;

See also