Horus Doc || Global Function Guide || General documentation   | Function documentation  

HxTan

Synopsis

HxImageRep HxTan (HxImageRep img)

Input

HxImageRep img
The image you want to take the tangent of.

Return value

HxImageRep
The pixelwise tangent of the input image.

Description

This function takes the tangent of every pixel value of the input image. For vector images, the tangent of every element of the vector is taken. Note that the tangent is not defined for number where k is an integer.

Remarks

Valid input images
All pixel values of the input image should be different from where k is an integer. The function does not check on this condition. If a pixel value is invalid a `not a number' is returned.

Overflow error
The function HxTan can result in an overflow error.

Examples

Taking the tangent of an image.

#include "HxImageRepGlobalFuncs.h"
#include "HxImageRep.h"

HxImageRep HxTanExample1(HxImageRep img) {
   img = HxImageAsDouble(img);
   img = HxContrastStretch(img, 3.0);
   img = HxSubVal(img, 1.5);
   img = HxTan(img);
   img = HxContrastStretch(img, 255.0);
   img = HxImageAsByte(img);

   return img;
}

int main(int argc, char* argv[])
{
    HxImageRep img = HxMakeFromFile(argv[1]);
    img = HxTanExample1(img);
    HxWriteFile(img, argv[2]);

    return 0;
}

exampleImage1.gif

Input image for the HxTan example.

HxTanResult1.gif

Output image of the HxTan example.

This example illustrates the result of taking the tangent of an image

See also

HxSin, HxCos, HxAtan, HxTanh,

Keywords

Unary, Trigonometric,


Generated on Mon Jan 27 15:45:02 2003 for GlobalFunctionGuide by doxygen1.2.12 written by Dimitri van Heesch, © 1997-2001