Panda3D

Loading...
Searching...
No Matches
Functions
cmath.h File Reference

PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University. More...

`#include "dtoolbase.h"`
`#include <cmath>`
`#include <cfloat>`
`#include <limits>`
`#include "cmath.I"`

Go to the source code of this file.

## Functions
double | cabs (double v)
float | cabs (float v)
double | cacos (double v)
float | cacos (float v)
double | casin (double v)
float | casin (float v)
double | catan (double v)
float | catan (float v)
double | catan2 (double y, double x)
float | catan2 (float y, float x)
double | cceil (double f)
double | ccos (double v)
float | ccos (float v)
double | cfloor (double f)
double | cfrac (double f)
| Returns the fractional component of f: f - cfloor(f).
bool | cinf (double v)
bool | cinf (float v)
double | cmod (double x, double y)
| This is similar to fmod(), but it behaves properly when x is negative: that is, it always returns a value in the range [0, y), assuming y is positive.
float | cmod (float x, float y)
| This is similar to fmod(), but it behaves properly when x is negative: that is, it always returns a value in the range [0, y), assuming y is positive.
int | cmod (int x, int y)
| This is similar to fmod(), but it behaves properly when x is negative: that is, it always returns a value in the range [0, y), assuming y is positive.
bool | cnan (double v)
bool | cnan (float v)
double | cpow (double x, double y)
float | cpow (float x, float y)
int | cpow (int x, int y)
double | csin (double v)
float | csin (float v)
float | csin_over_x (float v)
| Computes sin(x) / x, well-behaved as x approaches 0.
void | csincos (double v, double *sin_result, double *cos_result)
void | csincos (float v, float *sin_result, float *cos_result)
double | csqrt (double v)
float | csqrt (float v)
double | ctan (double v)
float | ctan (float v)
double | make_inf (double)
float | make_inf (float)
double | make_nan (double)
float | make_nan (float)

## Detailed Description

PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.

All rights reserved.

All use of this software is subject to the terms of the revised BSD license. You should have received a copy of this license along with this source code in a file named "LICENSE."

Author
  drose

Date
  2000-05-19

Definition in file cmath.h.

## Function Documentation

## ◆ cabs() [1/2]

double cabs | ( | double | v | ) |
| inline

Definition at line 256 of file cmath.I.

## ◆ cabs() [2/2]

float cabs | ( | float | v | ) |
| inline

Definition at line 89 of file cmath.I.

## ◆ cacos() [1/2]

double cacos | ( | double | v | ) |
| inline

Definition at line 288 of file cmath.I.

## ◆ cacos() [2/2]

float cacos | ( | float | v | ) |
| inline

Definition at line 121 of file cmath.I.

## ◆ casin() [1/2]

double casin | ( | double | v | ) |
| inline

Definition at line 280 of file cmath.I.

## ◆ casin() [2/2]

float casin | ( | float | v | ) |
| inline

Definition at line 113 of file cmath.I.

## ◆ catan() [1/2]

double catan | ( | double | v | ) |
| inline

Definition at line 264 of file cmath.I.

## ◆ catan() [2/2]

float catan | ( | float | v | ) |
| inline

Definition at line 97 of file cmath.I.

## ◆ catan2() [1/2]

double catan2 | ( | double | y,
|  | double | x )
| inline

Definition at line 272 of file cmath.I.

## ◆ catan2() [2/2]

float catan2 | ( | float | y,
|  | float | x )
| inline

Definition at line 105 of file cmath.I.

## ◆ cceil()

double cceil | ( | double | f | ) |
| inline

Definition at line 165 of file cmath.I.

## ◆ ccos() [1/2]

double ccos | ( | double | v | ) |
| inline

Definition at line 207 of file cmath.I.

## ◆ ccos() [2/2]

float ccos | ( | float | v | ) |
| inline

Definition at line 40 of file cmath.I.

## ◆ cfloor()

double cfloor | ( | double | f | ) |
| inline

Definition at line 147 of file cmath.I.

## ◆ cfrac()

double cfrac | ( | double | f | ) |
| inline

Returns the fractional component of f: f - cfloor(f).

Definition at line 183 of file cmath.I.

## ◆ cinf() [1/2]

bool cinf | ( | double | v | ) |
| inline

Definition at line 382 of file cmath.I.

## ◆ cinf() [2/2]

bool cinf | ( | float | v | ) |
| inline

Definition at line 366 of file cmath.I.

## ◆ cmod() [1/3]

double cmod | ( | double | x,
|  | double | y )
| inline

This is similar to fmod(), but it behaves properly when x is negative: that is, it always returns a value in the range [0, y), assuming y is positive.

Definition at line 297 of file cmath.I.

## ◆ cmod() [2/3]

float cmod | ( | float | x,
|  | float | y )
| inline

This is similar to fmod(), but it behaves properly when x is negative: that is, it always returns a value in the range [0, y), assuming y is positive.

Definition at line 130 of file cmath.I.

Referenced by UvScrollNode::cull_callback().

## ◆ cmod() [3/3]

int cmod | ( | int | x,
|  | int | y )
| inline

This is similar to fmod(), but it behaves properly when x is negative: that is, it always returns a value in the range [0, y), assuming y is positive.

This integer-valued function is provided since the built-in modulo operator % does not work properly for negative x.

Definition at line 434 of file cmath.I.

## ◆ cnan() [1/2]

bool cnan | ( | double | v | ) |
| inline

Definition at line 350 of file cmath.I.

## ◆ cnan() [2/2]

bool cnan | ( | float | v | ) |
| inline

Definition at line 334 of file cmath.I.

## ◆ cpow() [1/3]

double cpow | ( | double | x,
|  | double | y )
| inline

Definition at line 305 of file cmath.I.

## ◆ cpow() [2/3]

float cpow | ( | float | x,
|  | float | y )
| inline

Definition at line 138 of file cmath.I.

## ◆ cpow() [3/3]

int cpow | ( | int | x,
|  | int | y )
| inline

Definition at line 313 of file cmath.I.

## ◆ csin() [1/2]

double csin | ( | double | v | ) |
| inline

Definition at line 199 of file cmath.I.

## ◆ csin() [2/2]

float csin | ( | float | v | ) |
| inline

Definition at line 32 of file cmath.I.

## ◆ csin_over_x()

float csin_over_x | ( | float | v | ) |
| inline

Computes sin(x) / x, well-behaved as x approaches 0.

Definition at line 77 of file cmath.I.

## ◆ csincos() [1/2]

void csincos | ( | double | v,
|  | double * | sin_result,
|  | double * | cos_result )
| inline

Definition at line 223 of file cmath.I.

## ◆ csincos() [2/2]

void csincos | ( | float | v,
|  | float * | sin_result,
|  | float * | cos_result )
| inline

Definition at line 55 of file cmath.I.

## ◆ csqrt() [1/2]

double csqrt | ( | double | v | ) |
| inline

Definition at line 191 of file cmath.I.

## ◆ csqrt() [2/2]

float csqrt | ( | float | v | ) |
| inline

Definition at line 24 of file cmath.I.

## ◆ ctan() [1/2]

double ctan | ( | double | v | ) |
| inline

Definition at line 215 of file cmath.I.

## ◆ ctan() [2/2]

float ctan | ( | float | v | ) |
| inline

Definition at line 47 of file cmath.I.

## ◆ make_inf() [1/2]

double make_inf | ( | double |  | ) |
| inline

Definition at line 422 of file cmath.I.

## ◆ make_inf() [2/2]

float make_inf | ( | float |  | ) |
| inline

Definition at line 414 of file cmath.I.

## ◆ make_nan() [1/2]

double make_nan | ( | double |  | ) |
| inline

Definition at line 406 of file cmath.I.

## ◆ make_nan() [2/2]

float make_nan | ( | float |  | ) |
| inline

Definition at line 398 of file cmath.I.