Package healpix.essentials

# Class HealpixUtils

java.lang.Object
healpix.essentials.HealpixUtils

public class HealpixUtils extends Object
Collection of utility functions.

## Constructor Summary

Constructors
Constructor
Description
`HealpixUtils()`

## Method Summary

Modifier and Type
Method
Description
`static boolean`
`approx(double a, double b, double epsilon)`
`static boolean`
`approx(float a, float b, float epsilon)`
`static void`
`check(boolean cond, String errtxt)`
Evaluates cond; if it is false, throws an Exception containing errtxt.
`static double`
`cosdist_zphi(double z1, double phi1, double z2, double phi2)`
Computes the cosine of the angular distance between two z, phi positions on the unit sphere.
`static double`
`cosdist_zphi(Zphi zp1, Zphi zp2)`
Computes the cosine of the angular distance between two z, phi positions on the unit sphere.
`static double`
`fmodulo(double v1, double v2)`
Returns the remainder of the division `v1/v2`.
`static int`
`ilog2(long arg)`
Integer base 2 logarithm.
`static int`
`isqrt(long arg)`
Integer square root.
`static long`
`nest2peano(long pix, int order)`
`static long`
`peano2nest(long pix, int order)`
`static int`
`uniq2order(long uniq)`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### HealpixUtils

public HealpixUtils()

## Method Details

### check

public static void check(boolean cond, String errtxt) throws Exception
Evaluates cond; if it is false, throws an Exception containing errtxt.

Throws:
  `Exception`

### ilog2

public static int ilog2(long arg)
Integer base 2 logarithm.

Parameters:
  `arg` -
Returns:
  the largest integer `n` that fulfills `2^n<=arg`. For negative arguments and zero, 0 is returned.

### isqrt

public static int isqrt(long arg)
Integer square root.

Parameters:
  `arg` -
Returns:
  the integer `n` which fulfills `n^2<=arg<(n+1)^2`

### cosdist_zphi

public static double cosdist_zphi(double z1, double phi1, double z2, double phi2)
Computes the cosine of the angular distance between two z, phi positions on the unit sphere.

### cosdist_zphi

public static double cosdist_zphi(Zphi zp1, Zphi zp2)
Computes the cosine of the angular distance between two z, phi positions on the unit sphere.

### fmodulo

public static double fmodulo(double v1, double v2)
Returns the remainder of the division `v1/v2`. The result is non-negative.

Parameters:
  `v1` - dividend; can be positive or negative
  `v2` - divisor; must be positive
Returns:
  remainder of the division; positive and smaller than `v2`

### approx

public static boolean approx(float a, float b, float epsilon)

### approx

public static boolean approx(double a, double b, double epsilon)

### uniq2order

public static int uniq2order(long uniq)

### nest2peano

public static long nest2peano(long pix, int order)

### peano2nest

public static long peano2nest(long pix, int order)