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
>>
>>

Octave sin of 30 degrees

Compute the value of  \large sin(\frac{\pi }{2})

>> sin(pi/2)
ans = 1

Compute the value of  \large cos(\frac{\pi }{4})

>> cos(pi/4)
ans = 0.70711

Compute the value of \large tan( \frac{\pi }{4})

>> 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

 

Octave Function Case Sensitive

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 Package List

Octave /

Install Octave Packages on Linux

Octave /

Octave User defined Function Example

octave command line linux

Octave /

Octave Command line on Ubuntu

Hello World in Octave

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

  • Install RAPTOR Avalonia on CentOS
  • Download RAPTOR Avalonia Edition on Windows
  • npm doctor command
  • Print Triangle Pattern Flowchart
  • RAPTOR Editions
  • Flowgorithm Conditional Breakpoint Statement
  • Flowgorithm Read Numbers from File Example
  • Search Text File Flowchart Example
  • Flowgorithm Turtle Graphics Symbols
  • Draw Circle using Flowgorithm Turtle

Back to Top

Links

  • Contact
  • Privacy Policy
  • Cookie Policy

www.TestingDocs.com

Go to mobile version