TestingDocs.com
Software Testing website
  • Automation
    • Selenium
    • JBehave Framework
  • Tutorials
    • MySQL Tutorials
    • Testlink
    • Maven
    • Git
  • IDEs
    • IntelliJ IDEA
    • Eclipse
  • Flowcharts
    • Flowgorithm
    • Raptor
  • About

Octave

Octave Trigonometric Functions

Overview

In this tutorial, we will learn about Octave Trigonometric Functions. All the trigonometric functions are available in Octave.

Trigonometric Functions

Octave supports basic trigonometric functions like sin, cos, tan, etc.

The trigonometric functions are as follows:

 

Trigonometric Function
Description
sin(x)

 

To compute the sine of an angle, x in radians.
cos(x) To compute the cosine of an angle, x in radians.
tan(x) To compute the tangent of an angle, x in radians.
sec(x) To compute the secant of an angle, x in radians.
csc(x) To compute the cosecant of an angle, x in radians.
cot(x) To compute the cotangent of an angle, x in radians.

Examples

It is important to note that the argument for the function should be in radians.

Compute sin of 30 degrees.

>> % To calculate sin of 30 degrees
>> sin(30)
ans = -0.9880
>> % The above answer is wrong
>> sin(30*pi/180)
ans = 0.5000
>>
>>

Compute the value of 

>> sin(pi/2)
ans = 1

Compute the value of 

>> cos(pi/4)
ans = 0.70711

Compute the value of

>> tan(pi/4)
ans = 1.00000

 

Note that Octave is a case-sensitive language. The function names sin(x) and Sin(x) are different. In fact, if we haven’t defined any function with the name Sin, we would get the following function undefined error:

>> Sin(x)
error: ‘Sin’ undefined near line 1, column 1

 

Inverse Trigonometric Functions

https://www.testingdocs.com/inverse-trigonometric-functions-in-octave/

—

Octave Tutorials

Octave Tutorial on this website can be found at:
https://www.testingdocs.com/octave-tutorial/

More information on Octave can be found on the official website:
https://www.gnu.org/software/octave/index

Related Posts

Octave /

Install Octave Packages on Linux

Octave /

Octave User defined Function Example

Octave /

Octave Command line on Ubuntu

Octave /

Hello World in Octave

Octave /

Octave plot example of function y=x^2

‹ Octave help command› Solve Linear Algebraic Equations using Octave

Recent Posts

  • Scaler Academy – An Online Learning Platform
  • Difference between PHP and JavaScript?
  • MS Access Data Types
  • Install RAPTOR Avalonia on CentOS
  • Download RAPTOR Avalonia Edition on Windows
  • npm doctor command
  • Build & Run CLion Project
  • Create New CLion C Project on Windows
  • Configure CLion Toolchains on Windows
  • Launch CLion IDE on Windows

Back to Top

Links

  • Contact
  • Privacy Policy
  • Cookie Policy

www.TestingDocs.com