28029 Parallax Inc, 28029 Datasheet - Page 114

KIT PARTS SMART SENSORS W/TEXT

28029

Manufacturer Part Number
28029
Description
KIT PARTS SMART SENSORS W/TEXT
Manufacturer
Parallax Inc
Datasheet

Specifications of 28029

Accessory Type
Parts Kit
Product
Microcontroller Accessories
Lead Free Status / RoHS Status
Contains lead / RoHS non-compliant
For Use With/related Products
BASIC Stamp® or Javelin Modules
Lead Free Status / RoHS Status
Lead free / RoHS Compliant, Contains lead / RoHS non-compliant
Other names
28029PAR
Page 102 · Smart Sensors and Applications
sine
cosine VAR Word
DEBUG "Degrees
FOR degrees = 0 TO 359 STEP 15
NEXT
END
Your Turn - Program Modifications
Arcsine and Arccosine Subroutines
While the sine is a ratio of y/h for a given angle, arcsine (sin
see in Figure 3-30. Given the ratio y/h, arcsine tells you the angle. Likewise, cosine is
the ratio of x/h for a given angle, and arccosine (cos
x/h.
While the BASIC Stamp does not have ASIN and ACOS operators, Tracy Allen, author
of the Stamps in Class text Applied Sensors, published some very nice subroutines that
brads = degrees ** 46733
sine = SIN brads
cosine = COS brads
DEBUG "
VAR Word
Try modifying the
Try modifying the program so that it prompts you for a degree value with the
DEBUGIN
SDEC3 degrees, "
SDEC3 brads, "
SDEC3 cosine, "
SDEC3 sine, CR
",
Brads
command and then displays the result.
sin
cos
Cosine
FOR
θ
",
θ
",
=
...
=
",
NEXT
y
h
x
h
Sine", CR
θ
θ
loop's
=
=
sin
cos
STEP
1
1
y
h
x
h
argument to get different values.
−1
) is the angle for a given ratio of
Figure 3-30
Sine, Arcsine, Cosine, and
Arccosine
−1
) is the inverse, as you can

Related parts for 28029