ASF Sensor API Numeric Precision.
This module defines numeric precision and the real-number representation used in the Atmel Software Framework common sensor service.
Copyright (c) 2011-2018 Microchip Technology Inc. and its subsidiaries.
#include "fixed.h"
Data Structures | |
struct | vector3_t |
scalar 3-dimensional vector More... | |
Typedefs | |
typedef float | float_t |
Scalar Value Format and Precision. More... | |
typedef float_t | scalar |
Floating-point scalar type. More... | |
typedef scalar | scalar_t |
Functions | |
static scalar_t | vector3_dot_product (vector3_t const *v, vector3_t const *w) |
Calculate a vector3_t dot-product. More... | |
static scalar_t | vector3_magnitude (vector3_t const *v) |
Calculate a vector3_t magnitude. More... | |
static void | vector3_scale (scalar_t s, vector3_t *v) |
Scale a vector3_t value (scalar multiplication) More... | |
typedef float float_t |
Scalar Value Format and Precision.
These types define a real number format and precision. C/C++ source code can be compiled with math libraries in single-precision floating point, double-precision floating point, or fixed-point versions.
The type float_t always specifies a C/C++ floating-point type and is a C99 standard type. The scalar type may be specified as a floating-point or fixed-point type, where the available fixed-point types are fixed_t (C/C++) and type math::fixed (C++ only).
Note that whenever the C++ math libraries - math::vector, math::matrix, &c.
Calculate a vector3_t dot-product.
References vector3_t::x, vector3_t::y, and vector3_t::z.
Referenced by vector3_magnitude().
Calculate a vector3_t magnitude.
References vector3_dot_product().
Referenced by field_direction(), run_sensor_accel_test(), and run_sensor_compass_test().
Scale a vector3_t value (scalar multiplication)
References vector3_t::x, vector3_t::y, and vector3_t::z.
Referenced by ak8975_get_field(), field_direction(), and hmc5883l_get_field().