User Tools

Site Tools


Sidebar

Home



G-Code


About

  Order of execution
  Parameters

G-Codes

M-Codes

Other Codes

O-Words

Comments

Functions

  abs[]
  acos[]
  active[]
  and[]
  asin[]
  atan2[]
  atan[]
  bin[]
  ceil[]
  chr[]
  cos[]
  datetime[]
  day[]
  dec[]
  defnz[]
  def[]
  deg2rad[]
  exists[]
  exp10[]
  exp2[]
  expr[][]
  exp[]
  e[]
  fix[]
  floor[]
  froms16[]
  froms32[]
  fromu16[]
  fromu32[]
  fup[]
  hex[]
  hour[]
  inc[]
  land[]
  lnand[]
  lnor[]
  lnot[]
  log10[]
  log2[]
  log[]
  lor[]
  lxnor[]
  lxor[]
  max3[]
  max[]
  millisec[]
  min3[]
  minute[]
  min[]
  mmtounit[]
  month[]
  nand[]
  nan[]
  nop[][]
  nor[]
  notexists[]
  not[]
  or[]
  pi[]
  pow[]
  rad2deg[]
  rand[]
  rounddec[]
  roundup[]
  round[]
  s16[]
  s32[]
  s8[]
  second[]
  shl[]
  shr[]
  sin[]
  sqrt[]
  sqr[]
  tan[]
  tomachine[]
  tos16[]
  tos32[]
  tou16[]
  tou32[]
  towork[]
  trunc[]
  u16[]
  u32[]
  u8[]
  unittomm[]
  xnor[]
  xor[]
  year[]

Operators

Macros

gcode:functions:func-acos

acos[]

Returns the arc cosine of number, expressed in degrees.

The acos[] function is a function that returns the arc cosine of a number. The arc cosine, or inverse cosine, of a number is the angle (in degrees) whose cosine is equal to the given number. The input to the function should be a value between -1 and +1, and the output will be in the range of 0 to 180 (degrees). For example, acos[1] would return 0 and acos[0.5] would return 60.

Syntax

acos[x]

Parameters

x Number whose arc cosine is computed, in the interval [-1,+1].
Return Value Principal arc cosine of x, in the interval [0,180] degrees.
If the argument is out of interval, return value is NaN.

Examples

#<result> = acos[0]
(print,#<result>)

result: 90


#<result> = acos[1]
(print,#<result>)

result: 0


#<result> = acos[0.5]
(print,#<result>)

result: 60

See also

gcode/functions/func-acos.txt · Last modified: 2023/01/26 12:05 by 127.0.0.1

Page Tools