Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
F
fwatch
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
8
Issues
8
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
fwatch
Commits
ed89fd5b
Commit
ed89fd5b
authored
Sep 11, 2014
by
Grzegorz Daniluk
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sincos: calculate sin/cos for full -360/360 deg range
parent
797d2335
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
0 deletions
+12
-0
sincos.c
sw/common/sincos.c
+12
-0
No files found.
sw/common/sincos.c
View file @
ed89fd5b
...
...
@@ -57,6 +57,12 @@ float small_sin(int deg)
deg
-=
90
;
if
(
deg
<=
90
)
return
q
*
SIN_LUP
[
255
-
(
int
)(
deg
*
SIN_STEP
)]
/
65535
.
0
;
deg
-=
90
;
if
(
deg
<=
90
)
return
-
q
*
SIN_LUP
[(
int
)(
deg
*
SIN_STEP
)]
/
65535
.
0
;
deg
-=
90
;
if
(
deg
<=
90
)
return
-
q
*
SIN_LUP
[
255
-
(
int
)(
deg
*
SIN_STEP
)]
/
65535
.
0
;
return
0xff
;
}
...
...
@@ -70,6 +76,12 @@ float small_cos(int deg)
deg
-=
90
;
if
(
deg
<=
90
)
return
-
SIN_LUP
[(
int
)(
deg
*
SIN_STEP
)]
/
65535
.
0
;
deg
-=
90
;
if
(
deg
<=
90
)
return
-
SIN_LUP
[
255
-
(
int
)(
deg
*
SIN_STEP
)]
/
65535
.
0
;
deg
-=
90
;
if
(
deg
<=
90
)
return
SIN_LUP
[(
int
)(
deg
*
SIN_STEP
)]
/
65535
.
0
;
return
0xff
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment