So I’m making a TD game where I can place a gatling gun, and depending on which sector of a surrounding circle the mouse is in, the sprite and bullet path will change. My difficulty is with creating an algorithm which will tell me which sector my mouse is in. My circle has 16 sectors, and a radius of 300.
Tag: trigonometry
Find the coordinate given the angle and distance from a point
I am trying to draw lines on android canvas by calculating the last point (X,Y) given a point (Xo,Yo), the distance and the angle. A diagram is illustrated below: I am calculating the azimuth …
Transforming compass direction output
I have directional outputs which are both flipped and + – as appose to genuine compass outputs. I want to convert these using math to give me the correct output. I am pretty sure this can be done …
Get 3D coordinates of vertices of rotated and scaled cuboid with scale, center position and rotation on all axis
I have been wrecking my brain trying to figure out this problem I have. I have a cuboid, its rotation on all 3 axis in relation to the world from its center (it’s on 3D space), the cuboid’s center’s position and the scale of the cube in all axis (width, height and depth). I need to find the coordinates of