Skip to content

Commit

Permalink
improving math examples
Browse files Browse the repository at this point in the history
  • Loading branch information
TobyKLight committed Oct 13, 2023
1 parent 5259fe1 commit 5966720
Show file tree
Hide file tree
Showing 18 changed files with 227 additions and 158 deletions.
8 changes: 4 additions & 4 deletions help/Math/Explanation 01 Intro.vl
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
<p:stringtype p:Assembly="VL.Core" p:Type="VL.Core.StringType">Comment</p:stringtype>
</p:ValueBoxSettings>
</Pad>
<Pad Id="LM8lASGiMreL4eTFIcDP6a" Bounds="87,770,570,428" ShowValueBox="true" isIOBox="true" Value="You can imagine it like someone is standing at 0,0 and they are literally pointing in a direction and telling you how far away something is in that direction. &quot;It's that way, 3 steps&quot;. &#xD;&#xA;&#xD;&#xA;VECTOR by itself is expressed in relation to the origin (to the guy standing at 0,0 in the example above). You often need to add a vector back to a known position to do something with it in space. &#xD;&#xA;&#xD;&#xA;&#xD;&#xA;VECTORs are sometimes used to give us information about orientation (rotation) but we have to be careful. In 3D the vector does not give us information about every axis of rotation. &#xD;&#xA;If I said 'the object is pointing that way' and pointed with my arm that seems to give us information about orientation right? &#xD;&#xA;It depends on the usecase.&#xD;&#xA;If I'm talking about a building on planet earth and I'm pointing where the front door should be then we can assume the building isn't upside down so we have all the information we need to determine the buildings rotation. (This assumption is using a so called Up Vector to complete the rotation information)&#xD;&#xA;&#xD;&#xA;If I'm on a space station and pointing to where the airlock should be rotated to then that gives us a lot of information about the space station orientation but not all of it....its still unclear which way the space station could be rotated around the axis of my arm. Which might be very important for the spaceship to dock.">
<Pad Id="LM8lASGiMreL4eTFIcDP6a" Bounds="91,765,570,428" ShowValueBox="true" isIOBox="true" Value="You can imagine it like someone is standing at 0,0 and they are literally pointing in a direction and telling you how far away something is in that direction. &quot;It's that way, 3 steps&quot;. &#xD;&#xA;&#xD;&#xA;VECTOR by itself is expressed in relation to the origin (to the guy standing at 0,0 in the example above). You often need to add a vector back to a known position to do something with it in space. &#xD;&#xA;&#xD;&#xA;&#xD;&#xA;VECTORs are sometimes used to give us information about orientation (rotation) but we have to be careful. In 3D the vector does not give us information about every axis of rotation. &#xD;&#xA;If I said 'the object is pointing that way' and pointed with my arm that seems to give us information about orientation right? &#xD;&#xA;It depends on the usecase.&#xD;&#xA;If I'm talking about a building on planet earth and I'm pointing where the front door should be then we can assume the building isn't upside down so we have all the information we need to determine the buildings rotation. (This assumption about orientation of the building due to gravity is a so called &quot;Up Vector&quot;, used as a helper to complete the rotation information)&#xD;&#xA;&#xD;&#xA;If I'm on a space station and pointing to where the airlock should be for an incoming space ship then that gives us a lot of information about the space station orientation but not all of it....its still unclear which way the space station could be rotated around the axis of my arm. Which might be very important for the spaceship to dock.">
<p:TypeAnnotation LastCategoryFullName="Primitive" LastDependency="VL.CoreLib.vl">
<Choice Kind="TypeFlag" Name="String" />
</p:TypeAnnotation>
Expand All @@ -88,7 +88,7 @@
<p:stringtype p:Assembly="VL.Core" p:Type="VL.Core.StringType">Comment</p:stringtype>
</p:ValueBoxSettings>
</Pad>
<Pad Id="GyG07TwL1m0P9T1efCrzu4" Bounds="107,473,444,19" ShowValueBox="true" isIOBox="true" Value="https://app.element.io/#/room/#TransformingBrains:matrix.org">
<Pad Id="GyG07TwL1m0P9T1efCrzu4" Bounds="65,413,444,19" ShowValueBox="true" isIOBox="true" Value="https://app.element.io/#/room/#TransformingBrains:matrix.org">
<p:TypeAnnotation LastCategoryFullName="Primitive" LastDependency="VL.CoreLib.vl">
<Choice Kind="TypeFlag" Name="String" />
</p:TypeAnnotation>
Expand All @@ -97,7 +97,7 @@
<p:stringtype p:Assembly="VL.Core" p:Type="VL.Core.StringType">Link</p:stringtype>
</p:ValueBoxSettings>
</Pad>
<Pad Id="Ld2rAaxwbxzN1F9lNCHyNR" Bounds="115,427,748,28" ShowValueBox="true" isIOBox="true" Value="&lt;Join transforming brains channel&gt;">
<Pad Id="Ld2rAaxwbxzN1F9lNCHyNR" Bounds="73,367,748,28" ShowValueBox="true" isIOBox="true" Value="For more vvvv related maths support consider joining the 'transforming brains' matrix channel">
<p:TypeAnnotation LastCategoryFullName="Primitive" LastDependency="VL.CoreLib.vl">
<Choice Kind="TypeFlag" Name="String" />
</p:TypeAnnotation>
Expand All @@ -106,7 +106,7 @@
<p:stringtype p:Assembly="VL.Core" p:Type="VL.Core.StringType">Comment</p:stringtype>
</p:ValueBoxSettings>
</Pad>
<Pad Id="K25gFWJif9LN5ynnyZ6QV1" Bounds="67,504,744,79" ShowValueBox="true" isIOBox="true" Value="Helped me with the later bits quternions special thanks">
<Pad Id="K25gFWJif9LN5ynnyZ6QV1" Bounds="70,444,744,79" ShowValueBox="true" isIOBox="true" Value="Special thanks to the colleagues here, they helped me with the later bits ">
<p:TypeAnnotation LastCategoryFullName="Primitive" LastDependency="VL.CoreLib.vl">
<Choice Kind="TypeFlag" Name="String" />
</p:TypeAnnotation>
Expand Down
38 changes: 28 additions & 10 deletions help/Math/Explanation 02 1D Vectors.vl
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@
<p:fontsize p:Type="Int32">20</p:fontsize>
</p:ValueBoxSettings>
</Pad>
<Pad Id="Gyk6BjX60k8PUZlmu1nKGB" Bounds="494,1466,283,31" ShowValueBox="true" isIOBox="true" Value="&lt;&lt;Change concept here">
<Pad Id="Gyk6BjX60k8PUZlmu1nKGB" Bounds="494,1466,554,31" ShowValueBox="true" isIOBox="true" Value="&lt;&lt;Change concept visualisation here">
<p:TypeAnnotation LastCategoryFullName="Primitive" LastDependency="VL.CoreLib.vl">
<Choice Kind="TypeFlag" Name="String" />
</p:TypeAnnotation>
Expand Down Expand Up @@ -365,7 +365,7 @@
<p:stringtype p:Assembly="VL.Core" p:Type="VL.Core.StringType">Comment</p:stringtype>
</p:ValueBoxSettings>
</Pad>
<Pad Id="NBq3BgrHwR5NhRKoXlZUjz" Bounds="521,780,186,61" ShowValueBox="true" isIOBox="true" Value="In 1D this is equivelent to using the 'Abs' node (Absolute value)">
<Pad Id="NBq3BgrHwR5NhRKoXlZUjz" Bounds="521,780,186,61" ShowValueBox="true" isIOBox="true" Value="(Note: In 1D this is equivelent to using the 'Abs' node (Absolute value))">
<p:TypeAnnotation LastCategoryFullName="Primitive" LastDependency="VL.CoreLib.vl">
<Choice Kind="TypeFlag" Name="String" />
</p:TypeAnnotation>
Expand Down Expand Up @@ -402,7 +402,7 @@
<p:stringtype p:Assembly="VL.Core" p:Type="VL.Core.StringType">Comment</p:stringtype>
</p:ValueBoxSettings>
</Pad>
<Pad Id="VnolqtubH40Mbi9rbSSxaJ" Bounds="470,1067,286,118" ShowValueBox="true" isIOBox="true" Value="From microsoft docs of Vector.Normalize &quot;A normalized vector maintains its direction but its Length becomes 1. The resulting vector is often called a unit vector. &quot;&#xD;&#xA;&#xD;&#xA;The meaning of this becomes more clear later">
<Pad Id="VnolqtubH40Mbi9rbSSxaJ" Bounds="470,1067,286,129" ShowValueBox="true" isIOBox="true" Value="From microsoft docs of Vector.Normalize &quot;A normalized vector maintains its direction but its Length becomes 1. The resulting vector is often called a unit vector. &quot;&#xD;&#xA;&#xD;&#xA;The meaning of this will become more clear later">
<p:TypeAnnotation LastCategoryFullName="Primitive" LastDependency="VL.CoreLib.vl">
<Choice Kind="TypeFlag" Name="String" />
</p:TypeAnnotation>
Expand All @@ -411,7 +411,7 @@
<p:stringtype p:Assembly="VL.Core" p:Type="VL.Core.StringType">Comment</p:stringtype>
</p:ValueBoxSettings>
</Pad>
<Pad Id="BUXCpO7Yj66LEGX0C8t9WR" Bounds="434,1203,330,35" ShowValueBox="true" isIOBox="true" Value="Note special case of position 0 = length and direction of 0. ">
<Pad Id="BUXCpO7Yj66LEGX0C8t9WR" Bounds="439,1235,320,45" ShowValueBox="true" isIOBox="true" Value="Note special case of position 0 = length and direction of 0. ">
<p:TypeAnnotation LastCategoryFullName="Primitive" LastDependency="VL.CoreLib.vl">
<Choice Kind="TypeFlag" Name="String" />
</p:TypeAnnotation>
Expand Down Expand Up @@ -982,7 +982,7 @@
<Pin Id="Luz951DO6SpPUhJc4c1TeP" Name="Output" Kind="OutputPin" />
</Node>
<Pad Id="VQx4L9bYH6VPNfeKbuaEEg" Comment="PosB" Bounds="1574,752,35,15" ShowValueBox="true" isIOBox="true" />
<Pad Id="UGCd7BA3pJULd4uNPQrwnj" Bounds="1709,702,295,150" ShowValueBox="true" isIOBox="true" Value="Multiply the DIRECTION by the LENGTH . &#xD;&#xA;&#xD;&#xA;Add that to the ORIGINAL POSITION to get the NEW POSITION.&#xD;&#xA;&#xD;&#xA;This is why it's important the DIRECTION itself is effectively length 1, because its often multiplied by other things to set their direction. ">
<Pad Id="UGCd7BA3pJULd4uNPQrwnj" Bounds="1709,702,296,184" ShowValueBox="true" isIOBox="true" Value="To apply a vector to a position: &#xD;&#xA;Multiply the DIRECTION by the LENGTH . &#xD;&#xA;&#xD;&#xA;Add that to the ORIGINAL POSITION to get the NEW POSITION.&#xD;&#xA;&#xD;&#xA;This is why it's important the DIRECTION itself is effectively length 1 (AKA a Unit Vector), because its often multiplied by magnitude and it shouldn't change the size of that value.">
<p:TypeAnnotation LastCategoryFullName="Primitive" LastDependency="VL.CoreLib.vl">
<Choice Kind="TypeFlag" Name="String" />
</p:TypeAnnotation>
Expand All @@ -992,7 +992,7 @@
</p:ValueBoxSettings>
</Pad>
<Overlay Id="D6sS656yxU1OYOfm7K2O8e" Name="Concept 3: Be careful of float precision and equality" Bounds="2221,472,705,912" />
<Pad Id="AxW7SJqKBx8MmPnSixJifa" Bounds="2272,540,293,61" ShowValueBox="true" isIOBox="true" Value="What if we put it all together and test it?&#xD;&#xA;Go from vector properties to back again">
<Pad Id="AxW7SJqKBx8MmPnSixJifa" Bounds="2262,531,485,78" ShowValueBox="true" isIOBox="true" Value="What if we put it all together and test it?&#xD;&#xA;Calculate vector properties of PosB in relation to PosA, then add the vector properties back to PosA to reconstruct PosB. We should be able to achieve the same pos B.">
<p:TypeAnnotation LastCategoryFullName="Primitive" LastDependency="VL.CoreLib.vl">
<Choice Kind="TypeFlag" Name="String" />
</p:TypeAnnotation>
Expand Down Expand Up @@ -1078,7 +1078,7 @@
<Pin Id="Je0e4wDj2NvMTVm9MvRNyL" Name="Result" Kind="OutputPin" />
</Node>
<Pad Id="O9seTZYEkPYPZeX0apsaSl" Comment="IsEqual" Bounds="2670,1004,35,35" ShowValueBox="true" isIOBox="true" />
<Pad Id="A1YI8OYOseELmdeW2GKhzC" Bounds="2345,624,188,19" ShowValueBox="true" isIOBox="true" Value="&lt;&lt;Right click and scroll these">
<Pad Id="A1YI8OYOseELmdeW2GKhzC" Bounds="2352,615,188,19" ShowValueBox="true" isIOBox="true" Value="&lt;&lt;Right click and scroll these">
<p:TypeAnnotation LastCategoryFullName="Primitive" LastDependency="VL.CoreLib.vl">
<Choice Kind="TypeFlag" Name="String" />
</p:TypeAnnotation>
Expand All @@ -1089,7 +1089,7 @@
</Pad>
<ControlPoint Id="PCPZcOJtkcLPbhMWTQEQmT" Bounds="2678,671" />
<Pad Id="HEIJLvBJSDYNEqK258ipGi" Comment="TargetPosB" Bounds="2687,939,35,15" ShowValueBox="true" isIOBox="true" />
<Pad Id="GpAuooOzlvGPS5dpWcj1kk" Bounds="2248,1049,500,82" ShowValueBox="true" isIOBox="true" Value="You will see the IsEqual flicker, showing that the values aren't always equal, although they should be? &#xD;&#xA;&#xD;&#xA;This is due to floating point equality issues. &#xD;&#xA;&#xD;&#xA;&#xD;&#xA;">
<Pad Id="GpAuooOzlvGPS5dpWcj1kk" Bounds="2246,1091,500,82" ShowValueBox="true" isIOBox="true" Value="You will see the IsEqual flicker, showing that the values aren't always equal, although they should be? &#xD;&#xA;&#xD;&#xA;This is due to floating point equality issues. &#xD;&#xA;&#xD;&#xA;&#xD;&#xA;">
<p:TypeAnnotation LastCategoryFullName="Primitive" LastDependency="VL.CoreLib.vl">
<Choice Kind="TypeFlag" Name="String" />
</p:TypeAnnotation>
Expand All @@ -1098,7 +1098,7 @@
<p:stringtype p:Assembly="VL.Core" p:Type="VL.Core.StringType">Comment</p:stringtype>
</p:ValueBoxSettings>
</Pad>
<Pad Id="VmpSiQ91pMUOxxS1YNbcPH" Bounds="2248,1132,348,28" ShowValueBox="true" isIOBox="true" Value="https://floating-point-gui.de/errors/comparison/">
<Pad Id="VmpSiQ91pMUOxxS1YNbcPH" Bounds="2246,1174,348,28" ShowValueBox="true" isIOBox="true" Value="https://floating-point-gui.de/errors/comparison/">
<p:TypeAnnotation LastCategoryFullName="Primitive" LastDependency="VL.CoreLib.vl">
<Choice Kind="TypeFlag" Name="String" />
</p:TypeAnnotation>
Expand All @@ -1108,7 +1108,7 @@
</p:ValueBoxSettings>
</Pad>
<ControlPoint Id="B2UVRqWPcvRLBZyEu4ikqc" Bounds="2689,671" />
<Pad Id="MHGAnIt28WmPQr0D5d5Oic" Bounds="2248,1172,500,82" ShowValueBox="true" isIOBox="true" Value="Reccomend to detect equality with a range of succesful values (Epsilon) if you do vector equality.">
<Pad Id="MHGAnIt28WmPQr0D5d5Oic" Bounds="2246,1214,500,82" ShowValueBox="true" isIOBox="true" Value="Reccomend to detect equality with a range of succesful values (Epsilon) if you do vector equality.">
<p:TypeAnnotation LastCategoryFullName="Primitive" LastDependency="VL.CoreLib.vl">
<Choice Kind="TypeFlag" Name="String" />
</p:TypeAnnotation>
Expand All @@ -1126,6 +1126,24 @@
<p:stringtype p:Assembly="VL.Core" p:Type="VL.Core.StringType">Comment</p:stringtype>
</p:ValueBoxSettings>
</Pad>
<Pad Id="QfqbYK7Z4FFN5dTLgsZsYe" Bounds="128,29,486,35" ShowValueBox="true" isIOBox="true" Value="Go through each concept left to right and change the visualisation at the bottom.">
<p:TypeAnnotation LastCategoryFullName="Primitive" LastDependency="VL.CoreLib.vl">
<Choice Kind="TypeFlag" Name="String" />
</p:TypeAnnotation>
<p:ValueBoxSettings>
<p:fontsize p:Type="Int32">9</p:fontsize>
<p:stringtype p:Assembly="VL.Core" p:Type="VL.Core.StringType">Comment</p:stringtype>
</p:ValueBoxSettings>
</Pad>
<Pad Id="VVaSJaS1BHdLwNL34iXkoM" Bounds="3656,1627,500,82" ShowValueBox="true" isIOBox="true" Value="You will see the IsEqual flicker, showing that the values aren't always equal, although they should be? &#xD;&#xA;&#xD;&#xA;This is due to floating point equality issues. &#xD;&#xA;&#xD;&#xA;&#xD;&#xA;">
<p:TypeAnnotation LastCategoryFullName="Primitive" LastDependency="VL.CoreLib.vl">
<Choice Kind="TypeFlag" Name="String" />
</p:TypeAnnotation>
<p:ValueBoxSettings>
<p:fontsize p:Type="Int32">9</p:fontsize>
<p:stringtype p:Assembly="VL.Core" p:Type="VL.Core.StringType">Comment</p:stringtype>
</p:ValueBoxSettings>
</Pad>
</Canvas>
<Patch Id="RPzymNIqoCgMoeK994lrqk" Name="Create" />
<Patch Id="M2WZGSy13huN6nIfdjb8il" Name="Update" ParticipatingElements="GIN17mINiltM5unSUtGugX" />
Expand Down
Loading

0 comments on commit 5966720

Please sign in to comment.