# determing x,y increase by angle?

If I had a position of 0,0 and I had an angle of 45 degrees (or any number) and my velocity was 1 what would be the x,y increase?

For example if I had a 90 degree angle, and I had a velocity of 1. Then because my angle is straight up, my increase would be 1y and 0x.

Not sure if this makes sense, I am programming a small game, that shoots on any angle, and I need to pass it x and y coordinates so it shoots on the same angle.

Thanks!

Just need the equation, or a tutorial

-

## 1 Answer

From $(0,0)$ at angle $\theta$ at velocity $1$ you get to $x=\cos\theta$, $y=\sin\theta$. You know trigonometry?

-
used to! so if I had an angle of 45 it would just be x=cos45 and y=sin45 seems pretty straight forward. So x=0.707 and y = 1 – Johnny Quest Jun 27 '11 at 12:52
@Johnny, yes. – Gerry Myerson Jun 27 '11 at 12:55

1
@Johnny - $x$ looks fine by $y$ does not, as you should find $\cos 45 = \sin 45 = 1/\sqrt{2} \approx 0.707$ – Henry Jun 27 '11 at 13:05
oops, you are right, I did tan. is Y always going to be sin? If so why is that? – Johnny Quest Jun 27 '11 at 13:10

1
It is the definition of the sine as opposite/hypotenuse. Since your angle is measured from the $X$ axis, $v_x=v \cos(\theta), v_y=v \sin (\theta)$ – Ross Millikan Jun 27 '11 at 13:13
show 1 more comment
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 11, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "github"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "english_confidence": 0.9515752792358398, "perplexity_flag": "middle"}