Visual Basic I Programming

Slides:



Advertisements
Similar presentations
Arithmetic in Pascal (2) Arithmetic Functions Perform arithmetic calculations Gives an argument to the function and it returns the result.
Advertisements

The Inverse Trigonometric Functions Section 4.2. Objectives Find the exact value of expressions involving the inverse sine, cosine, and tangent functions.
Evaluating Sine & Cosine and and Tangent (Section 7.4)
7.3 Trigonometric Functions of Angles. Angle in Standard Position Distance r from ( x, y ) to origin always (+) r ( x, y ) x y  y x.
Pre calculus Problem of the Day Homework: p odds, odds, odds On the unit circle name all indicated angles by their first positive.
5.5 Solving Trigonometric Equations Example 1 A) Is a solution to ? B) Is a solution to cos x = sin 2x ?
Introduction to Matlab. Entering Commands Constants and Functions >> pi ans = >> eps ans = e-016 >> sin(pi/2) ans = 1 >> log(1000) ans =
5.1 Inverse sine, cosine, and tangent
Chapter 6: Trigonometry 6.1: Right-Triangle Trigonometry
6.3 – Trig Identities.
 Angles and Degree Measure › An angle is formed by two rays with a common endpoint › That endpoint is called the vertex › Angles can be labeled by the.
EXAMPLE 1 Finding Trigonometric Ratios For PQR, write the sine, cosine, and tangent ratios for P. SOLUTION For P, the length of the opposite side is 5.
Objectives ► The Inverse Sine Function ► The Inverse Cosine Function ► The Inverse Tangent Function ► The Inverse Secant, Cosecant, and Cotangent Functions.
5.1 Trigonometric Functions of Acute Angles Fri Oct 17 Do Now Solve for x 1) 1^2 + x^2 = 2^2 2) x^2 + x^2 = 1.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. A Concise Introduction to MATLAB ® William J. Palm III.
If is measured in radian Then: If is measured in radian Then: and: -
Warm Up Sign Up. AccPreCalc Lesson 27 Essential Question: How are trigonometric equations solved? Standards: Prove and apply trigonometric identities.
Visual Basic I Programming
1 TAC2000/ Protocol Engineering and Application Research Laboratory (PEARL) MATH Functions in C Language.
ANALYTIC TRIGONOMETRY UNIT 7. VERIFYING IDENTITIES LESSON 7.1.
Bell Work Find all coterminal angles with 125° Find a positive and a negative coterminal angle with 315°. Give the reference angle for 212°.
1 A unit circle has its center at the origin and a radius of 1 unit. 3.3 Definition III: Circular Functions.
CHAPTER 4 – LESSON 1 How do you graph sine and cosine by unwrapping the unit circle?
Slide Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley.
Warm- Up 1. Find the sine, cosine and tangent of  A. 2. Find x. 12 x 51° A.
1 © 2010 Pearson Education, Inc. All rights reserved © 2010 Pearson Education, Inc. All rights reserved Chapter 4 Trigonometric Functions.
STANDARD FUNCTIONS Computer Programming Asst. Prof. Dr. Choopan Rattanapoka and Asst. Prof. Dr. Suphot Chunwiphat.
13.7 (part 2) answers 34) y = cos (x – 1.5) 35) y = cos (x + 3/(2π)) 36) y = sin x –3π 37) 38) y = sin (x – 2) –4 39) y = cos (x +3) + π 40) y = sin (x.
Do Now: Graph the equation: X 2 + y 2 = 1 Draw and label the special right triangles What happens when the hypotenuse of each triangle equals 1?
Graphs of Other Trigonometric Functions
Graphs of the Trig Functions Objective To use the graphs of the trigonometric functions.
1 What you will learn  How to find the value of trigonometric ratios for acute angles of right triangles  More vocabulary than you can possibly stand!
5.3 The Unit Circle. A circle with center at (0, 0) and radius 1 is called a unit circle. The equation of this circle would be So points on this circle.
4.4 Trigonmetric functions of Any Angle. Objective Evaluate trigonometric functions of any angle Use reference angles to evaluate trig functions.
Finding Trigonometric Function Values using a Calculator Objective: Evaluate trigonometric functions using a calculator.
1 Ordinal types An ordinal data type is an ordered set in which every element, except the first element, has an immediate predecessor, and every element,
1 © 2011 Pearson Education, Inc. All rights reserved 1 © 2010 Pearson Education, Inc. All rights reserved © 2011 Pearson Education, Inc. All rights reserved.
Reciprocal functions secant, cosecant, cotangent Secant is the reciprocal of cosine. Reciprocal means to flip the ratio. Cosecant is the reciprocal of.
Limits Involving Trigonometric Functions
8-2 Trigonometric Ratios Warm Up Lesson Presentation Lesson Quiz
4.2 Trig Functions of Acute Angles. Trig Functions Adjacent Opposite Hypotenuse A B C Sine (θ) = sin = Cosine (θ ) = cos = Tangent (θ) = tan = Cosecant.
Describe the vertical shift in the graph of y = -2sin3x + 4. A.) Up 2 B.) Down 2 C.) Up 4 D.) Down 4.
Section 3 – Circular Functions Objective To find the values of the six trigonometric functions of an angle in standard position given a point on the terminal.
Warm up. Right Triangle Trigonometry Objective To learn the trigonometric functions and how they apply to a right triangle.
Reviewing Trigonometry Angle Measure Quadrant Express as a function of a positive acute angle Evaluate Find the angle Mixed Problems.
Trigonometric Functions: The Unit Circle
Review of radian measure.
Right Triangle Trigonometry
Section 4.2 The Unit Circle.
Introduction to the Six Trigonometric Functions & the Unit Circle
ECE 1304 Introduction to Electrical and Computer Engineering
BIL 104E Introduction to Scientific and Engineering Computing
Trigonometric Functions: The Unit Circle Section 4.2
Pre-Calc: 4.2: Trig functions: The unit circle
Computer Simulation Lab
Introduction to Programming
Math Library and IO formatting
Lesson 4.4 Trigonometric Functions of Any Angle
Evaluating Trigonometric Functions
Copyright © Cengage Learning. All rights reserved.
Trigonometric Functions
Right Triangle Ratios Chapter 6.
Warm-Up: February 3/4, 2016 Consider θ =60˚ Convert θ into radians
Right Triangle Ratios Chapter 6.
Graph of Secant, Cosecant, and Cotangent
Trigonometric Functions: Unit Circle Approach
Precalculus Essentials
Academy Algebra II THE UNIT CIRCLE.
Computer Simulation Lab
Copyright © Cengage Learning. All rights reserved.
Presentation transcript:

Visual Basic I Programming CSC 162 Visual Basic I Programming

Math and Number Functions Rounding Functions Trigonometric Functions Exponential and Logarithmic Functions Sign-Number Functions Random Number Function

Math and Number Functions Rounding Functions Round(x, y) Rounds x to y decimal places Examples: Round(5.23832, 2) produces 5.24 Round(5.23832, 1) produces 5.2 Round(5.23832, 0) produces 5 Int(x) Greatest integer function (rounds x down to the closest integer): Examples: Int(3.78) produces 3 Int(-3.78) produces -4 Fix(x) Rounds x down to the closest integer towards zero Examples: Fix(3.78) produces 3 Fix(-3.78) produces -3

Int vs. Fix Int Int -1 1 -2 2 3 4 -3 -4 Fix Fix -1 1 -2 2 3 4 -3 -4

Math and Number Functions Trigonometric Functions Sin(x) Sine of angle x (x measured in radians): sin(x) Example: Sin(0.52) produces 0.4969... Cos(x) Cosine of angle x (x measured in radians): cos(x) Example: Cos(0.7) produces 0.7648... Tan(x) Tangent of angle x (x measured in radians): tan(x) Example: Tan(0.854) produces 1.1476... Atn(x) Arctangent of x (result measured in radians): arctan(x) Example: Atn(1.148) produces 0.8452...

Math and Number Functions Exponential and Logarithmic Functions Exp(x) Exponential function: ex Example: Exp(2.1) produces 8.1662... Sqr(x) Square root of x: Examples: Sqr(4) produces 2 Sqr(2) produces 1.4142... Log(x) Natural logarithm of x: ln(x) or loge(x) Examples: Log(24) produces 3.1781... Log(2.789) produces 1.0257...

Logarithm Bases and Names log10(x) = log(x) loge(x) = ln(x) log2(x) = lg(x)

Math and Number Functions Sign-Number Functions Abs(x) Absolute value of x: | x | Examples: Abs(4) produces 4 Abs(0) produces 0 Abs(-7.2) produces 7.2 Sgn(x) Signum function (sign of x) Examples: Sgn(5.1) produces 1 Sgn(0) produces 0 Sgn(-3) produces -1

Math and Number Functions Random Number Function Rnd() Generates a random number: 0 ≤ x < 1 Examples: X = Rnd() produces 0.1245... X = Rnd() produces 0.7942... X = Rnd() produces 0.9997... To generate a random number: a ≤ x ≤ b X = Int(Rnd() * (b – a + 1)) + a

Random Number Generators

Math and Number Functions Obtaining π (pi) and e π (pi) Pi = 4 * Atn(1) e e = Exp(1) Converting between Degrees and Radians 180º ↔ πr Degrees to Radians Radians to Degrees

Programming Assignment 5 Lab Assignment Write a function DegToRad that converts an angle in degrees to radians. Use this function in a program that allows the user to input an angle (measured in degrees) in a textbox, and then computes the sine, cosine, tangent, cosecant, secant, and cotangent. Display these values in six textboxes with appropriate labels. Round all answers to four (4) decimal places Programming Assignment 5 Due Monday, November 10 / Tuesday, November 11 Page 241 #6.18 Page 241 #6.19