module Bottle::Trigonometry

Overview

A module primarily responsible for Tensor and Matrix trigonometric routines.

This module should be namespaced as part of the external API to provide user facing methods for creation.

Extended Modules

Direct including types

Defined in:

arrayops/trig.cr

Instance Method Summary

Macro Summary

Instance Method Detail

def acos(x1 : BaseArray) #

Calculates the acos of a Tensor

t1 = Tensor.new [1, 2, 3]

B.acos(t1)

[View source]
def acosh(x1 : BaseArray) #

Calculates the acosh of a Tensor

t1 = Tensor.new [1, 2, 3]

B.acosh(t1)

[View source]
def asin(x1 : BaseArray) #

Calculates the asin of a Tensor

t1 = Tensor.new [1, 2, 3]

B.asin(t1)

[View source]
def asinh(x1 : BaseArray) #

Calculates the asinh of a Tensor

t1 = Tensor.new [1, 2, 3]

B.asinh(t1)

[View source]
def atan(x1 : BaseArray) #

Calculates the atan of a Tensor

t1 = Tensor.new [1, 2, 3]

B.atan(t1)

[View source]
def atan2(x1 : BaseArray, x2 : BaseArray) #

Computes the atan2 of two Tensors elementwise

t1 = Tensor.new [1, 2, 3]
t2 = Tensor.new [4, 5, 6]

B.atan2(t1, t2)

[View source]
def atan2(x1 : BaseArray, x2 : Number) #

Computes the atan2 of a Tensor with a scalar elementwise

t1 = Tensor.new [1, 2, 3]
t2 = 5

B.atan2(t1, t2)

[View source]
def atan2(x1 : Number, x2 : BaseArray) #

atan2s a scalar with a tensor elementwise.

x = 5
t = Tensor.new [1, 2, 3]

B.atan2(x, t)

[View source]
def atan2 #

Returns the universal atan2 function. Used to apply outer operations, reductions, and accumulations to tensors

B.atan2 # => atan2


[View source]
def atanh(x1 : BaseArray) #

Calculates the atanh of a Tensor

t1 = Tensor.new [1, 2, 3]

B.atanh(t1)

[View source]
def besselj(x1 : BaseArray, x2 : BaseArray) #

Computes the besselj of two Tensors elementwise

t1 = Tensor.new [1, 2, 3]
t2 = Tensor.new [4, 5, 6]

B.besselj(t1, t2)

[View source]
def besselj(x1 : BaseArray, x2 : Number) #

Computes the besselj of a Tensor with a scalar elementwise

t1 = Tensor.new [1, 2, 3]
t2 = 5

B.besselj(t1, t2)

[View source]
def besselj(x1 : Number, x2 : BaseArray) #

besseljs a scalar with a tensor elementwise.

x = 5
t = Tensor.new [1, 2, 3]

B.besselj(x, t)

[View source]
def besselj #

Returns the universal besselj function. Used to apply outer operations, reductions, and accumulations to tensors

B.besselj # => besselj


[View source]
def besselj0(x1 : BaseArray) #

Calculates the besselj0 of a Tensor

t1 = Tensor.new [1, 2, 3]

B.besselj0(t1)

[View source]
def besselj1(x1 : BaseArray) #

Calculates the besselj1 of a Tensor

t1 = Tensor.new [1, 2, 3]

B.besselj1(t1)

[View source]
def bessely(x1 : BaseArray, x2 : BaseArray) #

Computes the bessely of two Tensors elementwise

t1 = Tensor.new [1, 2, 3]
t2 = Tensor.new [4, 5, 6]

B.bessely(t1, t2)

[View source]
def bessely(x1 : BaseArray, x2 : Number) #

Computes the bessely of a Tensor with a scalar elementwise

t1 = Tensor.new [1, 2, 3]
t2 = 5

B.bessely(t1, t2)

[View source]
def bessely(x1 : Number, x2 : BaseArray) #

besselys a scalar with a tensor elementwise.

x = 5
t = Tensor.new [1, 2, 3]

B.bessely(x, t)

[View source]
def bessely #

Returns the universal bessely function. Used to apply outer operations, reductions, and accumulations to tensors

B.bessely # => bessely


[View source]
def bessely0(x1 : BaseArray) #

Calculates the bessely0 of a Tensor

t1 = Tensor.new [1, 2, 3]

B.bessely0(t1)

[View source]
def bessely1(x1 : BaseArray) #

Calculates the bessely1 of a Tensor

t1 = Tensor.new [1, 2, 3]

B.bessely1(t1)

[View source]
def cbrt(x1 : BaseArray) #

Calculates the cbrt of a Tensor

t1 = Tensor.new [1, 2, 3]

B.cbrt(t1)

[View source]
def copysign(x1 : BaseArray, x2 : BaseArray) #

Computes the copysign of two Tensors elementwise

t1 = Tensor.new [1, 2, 3]
t2 = Tensor.new [4, 5, 6]

B.copysign(t1, t2)

[View source]
def copysign(x1 : BaseArray, x2 : Number) #

Computes the copysign of a Tensor with a scalar elementwise

t1 = Tensor.new [1, 2, 3]
t2 = 5

B.copysign(t1, t2)

[View source]
def copysign(x1 : Number, x2 : BaseArray) #

copysigns a scalar with a tensor elementwise.

x = 5
t = Tensor.new [1, 2, 3]

B.copysign(x, t)

[View source]
def copysign #

Returns the universal copysign function. Used to apply outer operations, reductions, and accumulations to tensors

B.copysign # => copysign


[View source]
def cos(x1 : BaseArray) #

Calculates the cos of a Tensor

t1 = Tensor.new [1, 2, 3]

B.cos(t1)

[View source]
def cosh(x1 : BaseArray) #

Calculates the cosh of a Tensor

t1 = Tensor.new [1, 2, 3]

B.cosh(t1)

[View source]
def degrees(x1 : BaseArray) #

Convert angles from radians to degrees.

t = Tensor.new [0, 1, 2, 3] * (Math::PI / 6)

degrees(t) # => Tensor[      0.0     30.0     60.0     90.0]

[View source]
def erf(x1 : BaseArray) #

Calculates the erf of a Tensor

t1 = Tensor.new [1, 2, 3]

B.erf(t1)

[View source]
def erfc(x1 : BaseArray) #

Calculates the erfc of a Tensor

t1 = Tensor.new [1, 2, 3]

B.erfc(t1)

[View source]
def exp(x1 : BaseArray) #

Calculates the exp of a Tensor

t1 = Tensor.new [1, 2, 3]

B.exp(t1)

[View source]
def exp2(x1 : BaseArray) #

Calculates the exp2 of a Tensor

t1 = Tensor.new [1, 2, 3]

B.exp2(t1)

[View source]
def expm1(x1 : BaseArray) #

Calculates the expm1 of a Tensor

t1 = Tensor.new [1, 2, 3]

B.expm1(t1)

[View source]
def frexp(x1 : BaseArray) #

Calculates the frexp of a Tensor

t1 = Tensor.new [1, 2, 3]

B.frexp(t1)

[View source]
def gamma(x1 : BaseArray) #

Calculates the gamma of a Tensor

t1 = Tensor.new [1, 2, 3]

B.gamma(t1)

[View source]
def hypot(x1 : BaseArray, x2 : BaseArray) #

Computes the hypot of two Tensors elementwise

t1 = Tensor.new [1, 2, 3]
t2 = Tensor.new [4, 5, 6]

B.hypot(t1, t2)

[View source]
def hypot(x1 : BaseArray, x2 : Number) #

Computes the hypot of a Tensor with a scalar elementwise

t1 = Tensor.new [1, 2, 3]
t2 = 5

B.hypot(t1, t2)

[View source]
def hypot(x1 : Number, x2 : BaseArray) #

hypots a scalar with a tensor elementwise.

x = 5
t = Tensor.new [1, 2, 3]

B.hypot(x, t)

[View source]
def hypot #

Returns the universal hypot function. Used to apply outer operations, reductions, and accumulations to tensors

B.hypot # => hypot


[View source]
def ilogb(x1 : BaseArray) #

Calculates the ilogb of a Tensor

t1 = Tensor.new [1, 2, 3]

B.ilogb(t1)

[View source]
def ldexp(x1 : BaseArray, x2 : BaseArray) #

Computes the ldexp of two Tensors elementwise

t1 = Tensor.new [1, 2, 3]
t2 = Tensor.new [4, 5, 6]

B.ldexp(t1, t2)

[View source]
def ldexp(x1 : BaseArray, x2 : Number) #

Computes the ldexp of a Tensor with a scalar elementwise

t1 = Tensor.new [1, 2, 3]
t2 = 5

B.ldexp(t1, t2)

[View source]
def ldexp(x1 : Number, x2 : BaseArray) #

ldexps a scalar with a tensor elementwise.

x = 5
t = Tensor.new [1, 2, 3]

B.ldexp(x, t)

[View source]
def ldexp #

Returns the universal ldexp function. Used to apply outer operations, reductions, and accumulations to tensors

B.ldexp # => ldexp


[View source]
def lgamma(x1 : BaseArray) #

Calculates the lgamma of a Tensor

t1 = Tensor.new [1, 2, 3]

B.lgamma(t1)

[View source]
def log(x1 : BaseArray) #

Calculates the log of a Tensor

t1 = Tensor.new [1, 2, 3]

B.log(t1)

[View source]
def log10(x1 : BaseArray) #

Calculates the log10 of a Tensor

t1 = Tensor.new [1, 2, 3]

B.log10(t1)

[View source]
def log1p(x1 : BaseArray) #

Calculates the log1p of a Tensor

t1 = Tensor.new [1, 2, 3]

B.log1p(t1)

[View source]
def log2(x1 : BaseArray) #

Calculates the log2 of a Tensor

t1 = Tensor.new [1, 2, 3]

B.log2(t1)

[View source]
def logb(x1 : BaseArray) #

Calculates the logb of a Tensor

t1 = Tensor.new [1, 2, 3]

B.logb(t1)

[View source]
def radians(x1 : BaseArray) #

Convert angles from degrees to radians

t = Tensor.new [30, 60, 90, 120]

radians(t) # => Tensor[     0.524     1.047     1.571     2.094]

[View source]
def sin(x1 : BaseArray) #

Calculates the sin of a Tensor

t1 = Tensor.new [1, 2, 3]

B.sin(t1)

[View source]
def sinh(x1 : BaseArray) #

Calculates the sinh of a Tensor

t1 = Tensor.new [1, 2, 3]

B.sinh(t1)

[View source]
def sqrt(x1 : BaseArray) #

Calculates the sqrt of a Tensor

t1 = Tensor.new [1, 2, 3]

B.sqrt(t1)

[View source]
def tan(x1 : BaseArray) #

Calculates the tan of a Tensor

t1 = Tensor.new [1, 2, 3]

B.tan(t1)

[View source]
def tanh(x1 : BaseArray) #

Calculates the tanh of a Tensor

t1 = Tensor.new [1, 2, 3]

B.tanh(t1)

[View source]

Macro Detail

macro trig(names) #

[View source]
macro trig2d(names) #

[View source]