Related Articles

Related Articles

Different uses of sine function in Julia – sinpi() and sinc() Method
  • Last Updated : 21 Apr, 2020

The sinpi() is an inbuilt function in julia which is used to compute the value of $\sin(\pi x)$ which is more accurately than sin(\pi*x), where x is the large value.

Syntax: sinpi(x)

Parameters:

  • x: Specified large value.

Returns: It returns the value of $\sin(\pi x)$ which is more accurately than sin(pi*x).

Example:



filter_none

edit
close

play_arrow

link
brightness_4
code

# Julia program to illustrate 
# the use of sinpi() method
  
# Getting the value of sin(pi x)
println(sinpi(55))
println(sinpi(22.7))
println(sinpi(3.17))
println(sinpi(22 / 7))

chevron_right


Output:

0.0
0.8090169943749488
-0.5090414157503711
-0.43388373911755795

sinc()

The sinc() is an inbuilt function in julia which is used to compute the value of $\sin(\pi x)/(\pi x)$.

Syntax: sinc(x)

Parameters:

  • x: Specified value.

Returns: It returns the value of $\sin(\pi x)/(\pi x)$.

Example:

filter_none

edit
close

play_arrow

link
brightness_4
code

# Julia program to illustrate 
# the use of sinc() method
  
# Getting the value of sin(pi x)/(pi x)
println(sinc(0))
println(sinc(1))
println(sinc(3.14))
println(sinc(22 / 7))

chevron_right


Output:

1
0
-0.043162343260348214
-0.04394392660493417



My Personal Notes arrow_drop_up
Recommended Articles
Page :