COS/de

From MCS Wiki AVR
< COS(Difference between revisions)
Jump to: navigation, search
((**COPIED FROM ENGLISH PAGE**) =)
(Example)
 
(3 intermediate revisions by one user not shown)
Line 9: Line 9:
 
= <span class="f_Header">Syntax</span> =
 
= <span class="f_Header">Syntax</span> =
  
var =&nbsp;<span class="f_Syntax">COS</span>( single )
+
var =&nbsp;<span class="f_Syntax">COS</span>( source )
  
 
<span style="font-family: Arial;">&nbsp;</span>
 
<span style="font-family: Arial;">&nbsp;</span>
Line 15: Line 15:
 
<span style="font-family: Arial;">&nbsp;</span>
 
<span style="font-family: Arial;">&nbsp;</span>
  
= <span class="f_Header">Remarks</span> =
+
= <span class="f_Header">Anmerkungen</span> =
 
<div style="padding: 0px; margin: 0px 0px 0px 4px;">
 
<div style="padding: 0px; margin: 0px 0px 0px 4px;">
 
{| width="539" cellspacing="0" cellpadding="1" border="1" style="border: 2px solid rgb(0, 0, 0); border-spacing: 0px; border-collapse: collapse;"
 
{| width="539" cellspacing="0" cellpadding="1" border="1" style="border: 2px solid rgb(0, 0, 0); border-spacing: 0px; border-collapse: collapse;"
 
|- style="vertical-align: top;"
 
|- style="vertical-align: top;"
| valign="top" width="15%" style="width: 77px; border: 1px solid rgb(0, 0, 0);" |  
+
| valign="top" width="13%" style="width: 66px; border: 1px solid rgb(0, 0, 0);" |  
Var
+
var
  
| valign="top" width="100%" style="width: 453px; border: 1px solid rgb(0, 0, 0);" |  
+
| valign="top" width="100%" style="width: 464px; border: 1px solid rgb(0, 0, 0);" |  
A numeric variable that is assigned with cosine of variable single.
+
Variable, der der Cosinuswert zugewiesen wird.
  
 
|- style="vertical-align: top;"
 
|- style="vertical-align: top;"
| valign="top" width="15%" style="width: 77px; border: 1px solid rgb(0, 0, 0);" |  
+
| valign="top" width="13%" style="width: 66px; border: 1px solid rgb(0, 0, 0);" |  
Single
+
source
  
| valign="top" width="100%" style="width: 453px; border: 1px solid rgb(0, 0, 0);" |  
+
| valign="top" width="100%" style="width: 464px; border: 1px solid rgb(0, 0, 0);" |  
The single variable to get the cosine of.
+
Single oder Double Variable von der der Cosinuswert berechnet werden soll.
  
 
|}
 
|}
Line 36: Line 36:
 
<span style="font-family: Arial;">&nbsp;</span>
 
<span style="font-family: Arial;">&nbsp;</span>
  
All trig functions work with radians. Use deg2rad and rad2deg to convert between radians and angles.
+
Alle trigonometrischen Funktionen arbeiten in BASCOM mit Radians. Benutzen Sie deg2rad bzw. rad2deg zum Umwandeln zwischen Radians und Winkelgrad.
  
 
<span style="font-family: Arial;">&nbsp;</span>
 
<span style="font-family: Arial;">&nbsp;</span>
Line 42: Line 42:
 
<span style="font-family: Arial;">&nbsp;</span>
 
<span style="font-family: Arial;">&nbsp;</span>
  
= <span class="f_Header">See Also</span> =
+
= <span class="f_Header">Siehe auch</span> =
  
 
[[RAD2DEG]]&nbsp;,&nbsp;[[DEG2RAD]]&nbsp;,&nbsp;[[ATN]]&nbsp;,&nbsp;[[SIN]]&nbsp;,&nbsp;[[TAN]]
 
[[RAD2DEG]]&nbsp;,&nbsp;[[DEG2RAD]]&nbsp;,&nbsp;[[ATN]]&nbsp;,&nbsp;[[SIN]]&nbsp;,&nbsp;[[TAN]]
Line 50: Line 50:
 
<span style="font-family: Arial;">&nbsp;</span>
 
<span style="font-family: Arial;">&nbsp;</span>
  
= <span class="f_Header">Example</span> =
+
= <span class="f_Header">Beispiel</span> =
  
 
<br/><source lang="bascomavr">
 
<br/><source lang="bascomavr">
$regfile = "m48def.dat" ' specify the used micro
+
$regfile = "m48def.dat" ' Mikrocontroller
$crystal = 8000000 ' used crystal frequency
+
$crystal = 8000000 ' Taktfrequenz
$baud = 19200 ' use baud rate
+
$baud = 19200 ' Baudrate
 
$hwstack = 32 ' default use 32 for the hardware stack
 
$hwstack = 32 ' default use 32 for the hardware stack
 
$swstack = 10 ' default use 10 for the SW stack
 
$swstack = 10 ' default use 10 for the SW stack

Latest revision as of 01:54, 1 March 2013

Contents

Funktion

Gibt den Cosinuswert einer Gleitkommazahl zurück.

 

 

Syntax

var = COS( source )

 

 

Anmerkungen

var

Variable, der der Cosinuswert zugewiesen wird.

source

Single oder Double Variable von der der Cosinuswert berechnet werden soll.

 

Alle trigonometrischen Funktionen arbeiten in BASCOM mit Radians. Benutzen Sie deg2rad bzw. rad2deg zum Umwandeln zwischen Radians und Winkelgrad.

 

 

Siehe auch

RAD2DEG , DEG2RAD , ATN , SIN , TAN

 

 

Beispiel


$regfile = "m48def.dat" ' Mikrocontroller
$crystal = 8000000 ' Taktfrequenz
$baud = 19200 ' Baudrate
$hwstack = 32 ' default use 32 for the hardware stack
$swstack = 10 ' default use 10 for the SW stack
$framesize = 40 ' default use 40 for the frame space
 
Config Com1 = Dummy , Synchrone = 0 , Parity = None , Stopbits = 1 , Databits = 8 , Clockpol = 0
 
Dim S As Single , X As Single
S = 0.5 : X = Tan(s) : Print X ' prints 0.546302195
S = 0.5 : X = Sin(s) : Print X ' prints 0.479419108
S = 0.5 : X = Cos(s) : Print X ' prints 0.877588389
End

Languages   English Deutsch  
Personal tools
Namespaces
Variants
Actions
Navigation
In other languages
Language