ethzasl-msf - Modular Sensor Fusion
Time delay compensated single and multi sensor fusion framework based on an EKF
Main Page
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
msf_core
include
msf_core
sincos.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2012, Markus Achtelik, ASL, ETH Zurich, Switzerland
3
* You can contact the author at <acmarkus at ethz dot ch>
4
*
5
* Licensed under the Apache License, Version 2.0 (the "License");
6
* you may not use this file except in compliance with the License.
7
* You may obtain a copy of the License at
8
*
9
* http://www.apache.org/licenses/LICENSE-2.0
10
*
11
* Unless required by applicable law or agreed to in writing, software
12
* distributed under the License is distributed on an "AS IS" BASIS,
13
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
* See the License for the specific language governing permissions and
15
* limitations under the License.
16
*/
17
#ifndef SINCOS_H_
18
#define SINCOS_H_
19
20
#ifdef __APPLE__
21
/* Possible method for setting __x87_inline_math__ */
22
#if (defined(__i386__) || defined(i386) || defined(__amd64) || defined(__x86_64))
23
#if (!defined(__x87_inline_math__) && defined(__FAST_MATH__))
24
#define __x87_inline_math__
25
#endif
26
#endif
27
28
#ifdef __x87_inline_math__
29
/*
30
** Compute sine and cosine at same time (faster than separate calls).
31
** (*s) gets sin(x)
32
** (*c) gets cos(x)
33
*/
34
#define sincos(x,s,c) sincos_x87_inline(x,s,c)
35
void
sincos_x87_inline(
double
x,
double
*s,
double
*c);
36
extern
__inline__
void
sincos_x87_inline(
double
x,
double
*s,
double
*c)
37
{
38
__asm__ (
"fsincos;"
:
"=t"
(*c),
"=u"
(*s) :
"0"
(x) :
"st(7)"
);
39
}
40
#else
41
#define sincos(th,x,y) { (*(x))=sin(th); (*(y))=cos(th); }
42
#endif
43
#endif
44
45
#endif // SINCOS_H_
Generated on Wed Nov 6 2013 22:21:53 for ethzasl-msf - Modular Sensor Fusion by
1.8.1.2