Atmel Software Framework

physics.h File Reference

ASF Sensor API physics utilities.

This module defines types and operations that support basic physical modelling and equations for sensor data.

Copyright (c) 2011-2012 Atmel Corporation. All rights reserved.

#include "constants.h"
#include "../math/precision.h"


bool field_direction (vector3_t *field, scalar_t *theta, scalar_t *delta, scalar_t *strength)
 Calculate direction, inclination, and field strength. More...

bool field_direction ( vector3_t field,
scalar_t theta,
scalar_t delta,
scalar_t strength 

Calculate direction, inclination, and field strength.

This routine calculates horizontal direction, vertical inclination and net field magnitude for a "raw" (unscaled) magnetic field sample from a 3-axis magnetometer.

fieldMagnetometer raw vector field sample input
thetaCalculated direction angle (degrees) output
deltaCalculated inclination angle (degrees) output
strengthCalculated raw vector field magnitude output
bool true if the call succeeds, else false is returned.

References degrees, vector3_magnitude(), vector3_scale(), vector3_t::x, vector3_t::y, and vector3_t::z.

Referenced by ak8975_get_heading(), and hmc5883l_get_heading().