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

Integral of a sign function proof
Best way working with trigonometric functions
Calculate place of point C to be equal distance away from points A and B
How to compute sum of angles from sine and cossine?
Counting trig ops as measure() function to fu() in sympy
Find a coordinate along a path
Angle calculation resulting in strange behavior
Shift angle orientation using atan2
estimate angle between two lines y = 1000x and y = 999x
Need help revising a simple formula to make it universal
SWIFT trig functions
Simplifying atan(tan(a+b))
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?

Categories

HOME
microsoftgraph
awk
jmeter
jmx
apache-spark-mllib
solaris
nuget
access
bitbucket-api
scripting
rds
augeas
octave
windows-ce
mautic
nancy
selenium-ide
scsi
package.json
google-container-registry
shortest-path
nim
ksh
exit
fat
pylons
firebase-analytics
quantlib
gp
testcomplete
google-earth
zend-debugger
jett
hunspell
swagger-php
google-knowledge-graph
setup.py
portforwarding
xmldocument
dynamic-linq
libgphoto2
configurationmanager
posixct
payara-micro
arq
qtranslate
payload
offline.js
stripe-connect
chromium-os
pure-css
reporting-services-2012
microstation
avspeechsynthesizer
kango-framework
riot
nss
query-by-example
ellucian-scribe
false-sharing
contentcontrol
directdraw
tfs-workitem
dllimport
xenomai
include-guards
page.js
haskell-warp
liquid-layout
dnssec
snackbar
procedural-programming
mass-assignment
sql-scripts
with-statement
template-deduction
ora-00904
spring-remoting
gae-quotas
koala
conditionaltagsupport
multitasking
beaker-testing
cffile
android-sdk-2.3
cakephp-1.2
iboutlet
boost-signals
cgbitmapcontextcreate
xui
twitterizer
objective-j
isapi-extension
silverlight-oob
software-lifecycle
technical-debt
great-circle

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