# Library functions and modules
# An operator is:
# A symbol that performs a task
# (The inputs to an operator are called
# "operands")
# A function is:
# A set of instructions that is provided
# a name
# Python comes with a set of built-in functions
# abs()
# print()
# raw_input()
# etc.
# E.G. raw_input has an "input" (argument)
# that is a string -- the prompt string
# and an "output" (return value) that
# is also a string -- what the user typed
# Library functions
# Python refers to "libraries" as "modules"
# A library (or module) is a set of functions
# In Python, modules can also contain constants
# defined to look like variables
#
# e.g. in the math module, the value for
# pi is defined as the constant "pi"
# Using library functions:
#
# You must "import" the library / module
#
# The book shows several ways to do this,
# but the easiest is:
# import
# e.g.
# import math
# import os
# import time
import math
# Side trip: Conversion between degrees and radians
#
# Conversion factor is pi/180 (or 180/pi)
# Suppose you have the var "degrees" which contains
# a number in degrees. To convert to radians
# use the conversion factor by using the
# math module's constant: pi
degrees = 90
radians = degrees * (math.pi / 180)
# Using the module's functions is just like
# normal (built-in) functions but we have to
# tell the math module name:
#
# Compute the sine of the angle provided
sine = math.sin(radians)
print sine