Given a circle with a known center point and two points on the circle (thus known radius), how do I determine the angle of the minimum arc between the two points on the circle?
I'm trying to work out a problem I'm having with degrees. I have data that is a list of of angles, in standard degree notation -- e.g. 26 deg.
Usually when dealing with angles, if an angle exceeds 360 deg then the angle continues around and effectively "resets" -- i.e. the angle "starts again", e.g. 357 deg, 358 deg, 359 deg, 0 deg, 1 deg, etc.…
Dear experts,
I wanted to implement ball physics and as i m newbie, i adapt the code in tutorial
http://adam21.web.officelive.com/Documents/JavaPhysicsTutorial.pdf .
i try to follow that as i much as i can,
but i m not able to apply all physical phenomenon in code, can somebody please tell me, where i m mistaken or i m still doing some silly…
I'm working on a raycaster in ActionScript 3.0 for the fun of it, and as a learning experience.
I've got it up and running and its displaying me output as expected however I'm getting this strange bug where rays go through corners of blocks and the edges of blocks appear through walls.
Maybe somebody with more experience can point out what I'm…
i am trying to graph the results of a survey, where the question is multiple choice.
eg. How would you describe this website?
format:
option | number of times selected | percentage of users who selected that option
Informative 1 50%
All of the above 1 50%
Interesting 0 0%
Intelligent 0 0%
Cool 0 0%
Incredible 0 …
I'm trying to build a custom clock view in Android. See image http://twitpic.com/1devk7
So far to draw the time and hour markers I have been using the Canvas.rotate method to get the desired effect. However, notice that it is difficult to interpret the numbers in the lower half of the clock (e.g. 6 or 9?) because of the angle in which they…
I have spent ages trying to figure this out and I am still having problems. I want to rotate an image a random number of time - say 5 and a bit - then have it stop. I then want to rotate it again FROM ITS STOPPED POSITION. I am having difficulty with this so maybe someone can advise me on the right way to do it.
Ok so I am using a…
What does the following function perform?
public static double CleanAngle(double angle) {
while (angle < 0)
angle += 2 * System.Math.PI;
while (angle > 2 * System.Math.PI)
angle -= 2 * System.Math.PI;
return angle;
}
This is how it is used with ATan2. I believe the…
I can't figure out how to set up a jquery rotate function that would only rotate on hover.
Here is the code that I am using:
$('div.settingsButton').hover(function() {
var angle = 0;
setInterval(function() {
angle += 4;
$(this).rotate(angle);
}, 50);
},
function() {
var angle = 0;
…
Before you continue reading this post, a suggestion; if you haven’t read “Programming Windows Phone 7 Series” by Charles Petzold, go read it. Now. If you find 150+ pages a little too long, at least go through Chapter 5, Principles of Movement, especially the section “A Brief Review of Vectors”. This post is largely…
I have been working on a game for quite long, think sonic classic physics in 3D or tony hawk psx, with unity3D. However I'm stuck at the most fundamental aspect of movement.
The requirement is that I need to move the character in mario 64 fashion (or sonic adventure) aka relative cam input:
the camera's forward…
Hey everyone I have this game that i am making in android and I have a touch screen joystick that moves the player around based on the joysticks position. I cant figure out how to also get the player to rotate at the same angle of the joystick. so when the joystick is to the left the players bitmap is rotated to…
Considering that I have a vector A, and after an arbitrary rotation I get vector B. I want to use this rotation operation in others vectors as well, but I'm having problems in doing that.
My idea do that is to calculate the perpendicular vector C of the plane AB (by calculating AxB). This vector C is the axis…
I have been working on a shooter game in C++, and am trying to add a feature whereby missiles shot must be within 90 degrees (PI/2 radians) of the direction the ship is facing. The missiles will be shot towards the mouse. My idea is that the ship's angle of rotation is compared with the angle between the ship…
I am having a slight problem with my Bump Mapping project. Although everything works OK (at least from what I know) there is a slight mistake somewhere and I get incorrect shading on the brick wall when the light goes to the one side or the other as seen in the picture below:
The light is on the right…
I have a direction vector on which I have to apply some rotation to align it to positive z-axis.
To use Matrix.CreateRotationX(angle) of XNA, I need the angle for which I'd have to compute cos or tan inverse.
I think this is a complex task to do. Also, eventually those are also converted to sin(angle)…
I remember I once composed a FPS viewing transformation, as a composition of 3 rotations, each with an angle as a parameter. The first angle specified the left/right rotation around the y-axis, the second angle the up/down rotation around the x-axis, and the third around the z-axis. The viewing…
My scene has a simple cube, and a camera built with the lookAt function (I'm using OpenGL). The scene renders fine, and I'm sure I have my model/view/projection matrices set up correctly.
Now I'm trying to implement arcball rotation for my camera, but I'm having some trouble. I've got it down…
so am still in the process of getting familiar with libGdx and one of the fun things i love to do is to make basics method for reusability on future projects, and for now am stacked on getting a Sprite rotate toward target (vector2) and then move forward based on that rotation
the code am…
this.createEmptyMovieClip('mask_mc',0);
bg_mc.setMask(mask_mc);
var contor:Number=0;
// function drawCircle draws a circle on mask_mc MovieClip of radius r and having center to mouse coordinates
function drawCircle(mask_mc:MovieClip):Void{
var r:Number = 20;
var xcenter:Number =…
Hi, I'm trying to create an honeycomb with as3 but I have some problem on cells positioning.
I've already created the cells (not with code) and for cycled them to a funcion and send to it the parameters which what I thought was need (the honeycomb cell is allready on a sprite container…
I'm solving the following problem: I have an object and I know its position now and its position 300ms ago. I assume the object is moving. I have a point to which I want the object to get.
What I need is to get the angle from my current object to the destination point in such a format…
I am working on a game in Javascript (HTML5 Canvas). I implemented a simple algorithm that allows an object to follow another object with basic physics mixed in (a force vector to drive the object in the right direction, and the velocity stacks momentum, but is slowed by a constant…
Hey all. I've got this code snippet, and I'm wondering why the results of the first method differ from the results of the second method, given the same input?
public double AngleBetween_1(vector a, vector b) {
var dotProd = a.Dot(b);
var lenProd = a.Len*b.Len;
var…