trigonometry


Flipping an angle using radians


Hello all you math whizzes out there!
I am struggling with a math problem I am hoping you can help me with. I have calculated an angle of direction using radians. Within OpenGL ES I move my guy by changing my point value as such:
spriteLocation.x -= playerSpeed * cosf(playerRadAngle);
spriteLocation.y -= playerSpeed * sinf(playerRadAngle);
// playerRadAgnle is my angle of direction using radians
This works very well to move my sprite in the correct direction. However, I have decided to keep my sprite "locked" in the middle of the screen and move the background instead. This requires me to Reverse my calculated angle. If my sprite's direction in radians is equivalent to 90 degrees, I want to convert it to 270 degrees. Again, keeping everything in radians.
I will admit that my knowledge of Trig is poor at best. Is there a way to figure out the opposite angle using radians? I know I could convert my radians into degrees, then add/subtract 180 degrees, then convert back to radians, but I'm looking for something more efficient.
Thanks in advance....
-Scott
Add/subtract pi instead.

Related Links

2 Different Radians constant calcuations whats the difference?
Trigonometry & Sunset
Calculating collisions with Radians incrementing
How do arbitrary-precision libraries like mpmath evaluate simple trigonometric functions?
How can I calculate the angle
Finding Shortest Distance Between Two Parallel Lines, With Arbitrary Point [closed]
how to convert depth in Z-cordinate
How can I simplify this expression with trigonometric in Maple?
Require trigonometry assistance with ship/wave movement
Trigonometry - Find where two curves intersect
How to calculate point 'along' unit circle radian [closed]
Issues with bullet entry points for “shoulder mounted” guns
Using the coordinates of two of a triangle's vertices to calculate the coordinates of the third
How to do the trig function Arc Cos (ACOS() in Excel) in MS-Access?
How to get the direction (angle) of rectangle after rotating it from a pivot point
How to calculate points of Chord

Categories

HOME
awk
nvd3.js
pagination
depth
3d
jelastic
javacc
tail
gembox-spreadsheet
babeljs
tvos
iis-6
angularfire2
opengl-3
barcode
bing-maps
jquery-ui-sortable
cmdb
openbugs
intercom
pybossa
comsol
entitymanager
scsi
job-scheduling
microsoft-dynamics-nav
google-picker
soci
foreign-keys
sencha-touch
simpleitk
direct3d11
shared
asymptotic-complexity
nstimer
android-maps
ms-access-2003
firebase-analytics
inversion-of-control
sqsh
simplecv
gojs
installshield-le
dynamic-jasper
hunspell
servicestack-text
playframework-2.1
bc
health-monitoring
spring-mvc-test
setup.py
resolution
laravel-elixir
subclipse
outputcache
file-sharing
plan-9
activeperl
reindex
semantic-logging
ngmaterial
py2neo
renaming
pocketsphinx-android
polyline
cvxpy
xcode-server
vulcanize
iotivity
android-wake-lock
project-organization
dbamp
halcon
cycle2
inf
computer-architecture
extjs-grid
pax-exam
canalyzer
phpldapadmin
dbaccess
sip-server
rickshaw
genymotion-call
universal-image-loader
mobility
mutual-authentication
spring-3
tlf
time.h
jdb
apache-commons-dbutils
clrstoredprocedure
strsep
http-daemon
svk
office-2007
hbm2java
spread

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App