You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, this is TOM.
I found some strange thing below code in handleUpdate function. It may be bug or not.
double xVel = sdi.getSpeed() * Math.cos(sdi.getCourse());
double yVel = sdi.getSpeed() * Math.sin(sdi.getCourse());
sdi.getCourse() return bearing of android location.
Unit of bearing is degree not radian. But argument of Math.cos/sin is an angle, in radians.
And the start point (zero degree) of bearing is north. so I think that code should be modified like below
double xVel = sdi.getSpeed() * Math.sin(Math.toRadians(sdi.getCourse()));
double yVel = sdi.getSpeed() * Math.cos(Math.toRadians(sdi.getCourse()));
The text was updated successfully, but these errors were encountered:
Hi, this is TOM.
I found some strange thing below code in handleUpdate function. It may be bug or not.
double xVel = sdi.getSpeed() * Math.cos(sdi.getCourse());
double yVel = sdi.getSpeed() * Math.sin(sdi.getCourse());
sdi.getCourse() return bearing of android location.
Unit of bearing is degree not radian. But argument of Math.cos/sin is an angle, in radians.
And the start point (zero degree) of bearing is north. so I think that code should be modified like below
double xVel = sdi.getSpeed() * Math.sin(Math.toRadians(sdi.getCourse()));
double yVel = sdi.getSpeed() * Math.cos(Math.toRadians(sdi.getCourse()));
The text was updated successfully, but these errors were encountered: