<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://inside.digipen.edu/index.php?action=history&amp;feed=atom&amp;title=GSDP%3AGAM100%2FCProcessing%2Fvec2_add%28%29</id>
	<title>GSDP:GAM100/CProcessing/vec2 add() - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://inside.digipen.edu/index.php?action=history&amp;feed=atom&amp;title=GSDP%3AGAM100%2FCProcessing%2Fvec2_add%28%29"/>
	<link rel="alternate" type="text/html" href="https://inside.digipen.edu/index.php?title=GSDP:GAM100/CProcessing/vec2_add()&amp;action=history"/>
	<updated>2026-04-06T01:56:24Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.35.2</generator>
	<entry>
		<id>https://inside.digipen.edu/index.php?title=GSDP:GAM100/CProcessing/vec2_add()&amp;diff=59525&amp;oldid=prev</id>
		<title>&gt;Zachary.logsdon at 00:26, 6 October 2019</title>
		<link rel="alternate" type="text/html" href="https://inside.digipen.edu/index.php?title=GSDP:GAM100/CProcessing/vec2_add()&amp;diff=59525&amp;oldid=prev"/>
		<updated>2019-10-06T00:26:33Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left diff-editfont-monospace&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 00:26, 6 October 2019&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l20&quot; &gt;Line 20:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 20:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;   speed = vec2_set(50.0f, 0.0f);&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;   speed = vec2_set(50.0f, 0.0f);&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;   &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;circleMode&lt;/del&gt;(CENTER);&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;   &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;ellipseMode&lt;/ins&gt;(CENTER);&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;   fill(color(255, 0, 0, 255));&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;   fill(color(255, 0, 0, 255));&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;}&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;}&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key insidedb135-dpw135:diff::1.12:old-59519:rev-59525 --&gt;
&lt;/table&gt;</summary>
		<author><name>&gt;Zachary.logsdon</name></author>
	</entry>
	<entry>
		<id>https://inside.digipen.edu/index.php?title=GSDP:GAM100/CProcessing/vec2_add()&amp;diff=59519&amp;oldid=prev</id>
		<title>&gt;Zachary.logsdon: New page: {{GSDP:GAM100API.css}} = vec2_add() = == Description == Returns the sum of two Vec2s as a new Vec2.  ==== Parameters ==== ...</title>
		<link rel="alternate" type="text/html" href="https://inside.digipen.edu/index.php?title=GSDP:GAM100/CProcessing/vec2_add()&amp;diff=59519&amp;oldid=prev"/>
		<updated>2019-07-01T16:14:43Z</updated>

		<summary type="html">&lt;p&gt;New page: {{GSDP:GAM100API.css}} = vec2_add() = == Description == Returns the sum of two &lt;a href=&quot;/main/GSDP:GAM100/CProcessing/Vec2&quot; title=&quot;GSDP:GAM100/CProcessing/Vec2&quot;&gt;Vec2s&lt;/a&gt; as a new &lt;a href=&quot;/main/GSDP:GAM100/CProcessing/Vec2&quot; title=&quot;GSDP:GAM100/CProcessing/Vec2&quot;&gt;Vec2&lt;/a&gt;.  ==== Parameters ==== ...&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{GSDP:GAM100API.css}}&lt;br /&gt;
= vec2_add() =&lt;br /&gt;
== Description ==&lt;br /&gt;
Returns the sum of two [[GSDP:GAM100/CProcessing/Vec2|Vec2]]s as a new [[GSDP:GAM100/CProcessing/Vec2|Vec2]].&lt;br /&gt;
&lt;br /&gt;
==== Parameters ====&lt;br /&gt;
vec2_add(Vec2 a, Vec2 b)&lt;br /&gt;
&lt;br /&gt;
*a - ([[GSDP:GAM100/CProcessing/Vec2|Vec2]]) Left hand operand of addition.&lt;br /&gt;
*b - ([[GSDP:GAM100/CProcessing/Vec2|Vec2]]) Right hand operand of addition.&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
&amp;lt;syntaxhighlight lang='c'&amp;gt;&lt;br /&gt;
Vec2 position;&lt;br /&gt;
Vec2 speed;&lt;br /&gt;
&lt;br /&gt;
void init()&lt;br /&gt;
{&lt;br /&gt;
  position = vec2_set(canvasWidth / 2, canvasHeight / 2);&lt;br /&gt;
  speed = vec2_set(50.0f, 0.0f);&lt;br /&gt;
&lt;br /&gt;
  circleMode(CENTER);&lt;br /&gt;
  fill(color(255, 0, 0, 255));&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
bool forward = true;&lt;br /&gt;
&lt;br /&gt;
void update()&lt;br /&gt;
{&lt;br /&gt;
  background(color(255, 255, 255, 255));&lt;br /&gt;
&lt;br /&gt;
  // Check if direction should be inverted&lt;br /&gt;
  if (position.x &amp;gt; canvasWidth)&lt;br /&gt;
  {&lt;br /&gt;
    forward = false;&lt;br /&gt;
    position.x = canvasWidth;&lt;br /&gt;
  }&lt;br /&gt;
  else if (position.x &amp;lt; 0)&lt;br /&gt;
  {&lt;br /&gt;
    forward = true;&lt;br /&gt;
    position.x = 0;&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  // Update position&lt;br /&gt;
  if (forward)&lt;br /&gt;
    position = vec2_add(position, vec2_scale(speed, dt()));&lt;br /&gt;
  else if(!forward)&lt;br /&gt;
    position = vec2_sub(position, vec2_scale(speed, dt()));&lt;br /&gt;
&lt;br /&gt;
  // Draw the circle&lt;br /&gt;
  circle(position.x, position.y, 40);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Related ====                            &lt;br /&gt;
* [[GSDP:GAM100/CProcessing                        |Main Page                ]]&lt;br /&gt;
* [[GSDP:GAM100/CProcessing/Vec2                   |Vec2                     ]]&lt;br /&gt;
* [[GSDP:GAM100/CProcessing/vec2()                 |vec2()                   ]]&lt;br /&gt;
* [[GSDP:GAM100/CProcessing/vec2_zero()            |vec2_zero()              ]]&lt;br /&gt;
* [[GSDP:GAM100/CProcessing/vec2_set()             |vec2_set()               ]]&lt;br /&gt;
* [[GSDP:GAM100/CProcessing/vec2_neg()             |vec2_neg()               ]]&lt;br /&gt;
* [[GSDP:GAM100/CProcessing/vec2_add()             |vec2_add()               ]]&lt;br /&gt;
* [[GSDP:GAM100/CProcessing/vec2_sub()             |vec2_sub()               ]]&lt;br /&gt;
* [[GSDP:GAM100/CProcessing/vec2_norm()            |vec2_norm()              ]]&lt;br /&gt;
* [[GSDP:GAM100/CProcessing/vec2_scale()           |vec2_scale()             ]]&lt;br /&gt;
* [[GSDP:GAM100/CProcessing/vec2_length()          |vec2_length()            ]]&lt;br /&gt;
* [[GSDP:GAM100/CProcessing/vec2_distance()        |vec2_distance()          ]]&lt;br /&gt;
* [[GSDP:GAM100/CProcessing/vec2_dot()             |vec2_dot()               ]]&lt;br /&gt;
* [[GSDP:GAM100/CProcessing/vec2_cross()           |vec2_cross()             ]]&lt;br /&gt;
* [[GSDP:GAM100/CProcessing/vec2_angle()           |vec2_angle()             ]]&lt;/div&gt;</summary>
		<author><name>&gt;Zachary.logsdon</name></author>
	</entry>
</feed>