# Math.im

From spatstat v1.41-1
by Adrian Baddeley

##### S3 Group Generic methods for images

These are group generic methods for images of class `"im"`

, which
allows for usual mathematical functions and operators to be applied
directly to images. See Details for a list of implemented functions.

##### Usage

```
## S3 methods for group generics have prototypes:
```Math(x, ...)
Ops(e1, e2)
Complex(z)
Summary(..., na.rm = FALSE)

##### Arguments

- x, z, e1, e2
- objects of class
`"im"`

. - ...
- further arguments passed to methods.
- na.rm
- logical: should missing values be removed?

##### Details

Below is a list of mathematical functions and operators which are
defined for images. Not all functions will make sense for all
types of images. For example, none of the functions in the `"Math"`

group
make sense for character-valued images. Note that the `"Ops"`

group methods are implemented using `eval.im`

, which tries
to harmonise images via `harmonise.im`

if they aren't
compatible to begin with.

- Group
`"Math"`

:`abs`

,`sign`

,`sqrt`

,`floor`

,`ceiling`

,`trunc`

,`round`

,`signif`

`exp`

,`log`

,`expm1`

,`log1p`

,`cos`

,`sin`

,`tan`

,`cospi`

,`sinpi`

,`tanpi`

,`acos`

,`asin`

,`atan`

`cosh`

,`sinh`

,`tanh`

,`acosh`

,`asinh`

,`atanh`

`lgamma`

,`gamma`

,`digamma`

,`trigamma`

`cumsum`

,`cumprod`

,`cummax`

,`cummin`

- Group
`"Ops"`

:`"+"`

,`"-"`

,`"*"`

,`"/"`

,`"^"`

,`"%%"`

,`"%/%"`

`"&"`

,`"|"`

,`"!"`

`"=="`

,`"!="`

,`"<"< code="">,`

`"<="< code="">,`

`">="`

,`">"`

- Group
`"Summary"`

:`all`

,`any`

`sum`

,`prod`

`min`

,`max`

`range`

- Group
`"Complex"`

:`Arg`

,`Conj`

,`Im`

,`Mod`

,`Re`

##### See Also

`eval.im`

for evaluating expressions involving images.

##### Examples

```
## Convert gradient values to angle of inclination:
inc <- atan(bei.extra$grad) * 180/pi
## Make logical image which is TRUE when heat equals 'Moderate':
A <- gorillas.extra$heat == "Moderate"
```

*Documentation reproduced from package spatstat, version 1.41-1, License: GPL (>= 2)*

### Community examples

Looks like there are no examples yet.