<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-3962515301035764383</id><updated>2012-03-14T02:59:03.057-07:00</updated><category term='OpenSource'/><title type='text'>Technically Correct</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://saecob.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3962515301035764383/posts/default/-/OpenSource'/><link rel='alternate' type='text/html' href='http://saecob.blogspot.com/search/label/OpenSource'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>saecob</name><uri>http://www.blogger.com/profile/07787653930456584171</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>9</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-3962515301035764383.post-3880909795744935577</id><published>2011-12-14T22:57:00.000-08:00</published><updated>2011-12-14T22:57:39.602-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='OpenSource'/><title type='text'>Math, Can't Outrun It</title><content type='html'>So my next big push is going to involve, adding a new function clone() to gladius.math to allow for cloning of matrices without incurring a new allocation. New branch created for this:&amp;nbsp; &lt;a href="https://github.com/saecob/gladius.math/tree/alpha"&gt;https://github.com/saecob/gladius.math/tree/alpha&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Simple enough with a source and destination parameter, copy one into the other.&amp;nbsp; The next step is to bring transform.js in line with the api.&amp;nbsp; The difficulty now is understanding the linear algebra used.&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Scale()&lt;/li&gt;&lt;li&gt;Rotate()&lt;/li&gt;&lt;li&gt;Translate()&lt;/li&gt;&lt;/ul&gt;Coming up with some clever tests and resources for this bit of code will be part of the challenge.&lt;br /&gt; &lt;br /&gt;After getting things sorted out with transform, one last pass over the unit tests to add some variety will need to be done.&amp;nbsp; After this maybe it will be time to take a look at our Algorithm scripts.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3962515301035764383-3880909795744935577?l=saecob.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://saecob.blogspot.com/feeds/3880909795744935577/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://saecob.blogspot.com/2011/12/math-cant-outrun-it.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3962515301035764383/posts/default/3880909795744935577'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3962515301035764383/posts/default/3880909795744935577'/><link rel='alternate' type='text/html' href='http://saecob.blogspot.com/2011/12/math-cant-outrun-it.html' title='Math, Can&apos;t Outrun It'/><author><name>saecob</name><uri>http://www.blogger.com/profile/07787653930456584171</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3962515301035764383.post-3117237127125536915</id><published>2011-12-12T17:42:00.000-08:00</published><updated>2011-12-12T17:42:47.472-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='OpenSource'/><title type='text'>Progress Central</title><content type='html'>Today after my exam i decided to knock out a bunch of implementations for Gladius.Math.&amp;nbsp; We now have a 90% complete implementation of the new API and its exciting. Check it out here: &lt;a href="https://github.com/saecob/gladius.math"&gt;https://github.com/saecob/gladius.math&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;The main work was done to Matrices of the 3x3 and 4x4 variety and of course the ever loved test scripts to go along with them.&amp;nbsp; The biggest change to get used to is definitely the addition of matrix lists as parameters for almost all of the matrix implementations.&lt;br /&gt;&lt;br /&gt;Because of this, i decided to iterate through the matrix list in each respective function and call the base Matrix class to complete the additions.&amp;nbsp; This looping system may have a pretty big impact on performance for long lists of matrices but for now it seems to be working fine.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-2punVqzf3Aw/Tuas9LRUf3I/AAAAAAAAAAk/3z-YTgiVPE0/s1600/Transform_Fix.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/-2punVqzf3Aw/Tuas9LRUf3I/AAAAAAAAAAk/3z-YTgiVPE0/s1600/Transform_Fix.jpg" /&gt;&lt;/a&gt;&lt;/div&gt;Along the way while updating Matrix4, i managed to break the transform methods as they were relying on the old method calls to multiply.&amp;nbsp; A simple fix but it will go in along with my next big update.&amp;nbsp; All i would need to do is to add the 2 matrices being multiplied to a list and pass that parameter.&lt;br /&gt;&lt;br /&gt;The next big update will include Quaternion and Transform method implementations and tests, along with some way to allow a developer to clone a matrix/vector without incurring a new allocation.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3962515301035764383-3117237127125536915?l=saecob.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://saecob.blogspot.com/feeds/3117237127125536915/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://saecob.blogspot.com/2011/12/progress-central.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3962515301035764383/posts/default/3117237127125536915'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3962515301035764383/posts/default/3117237127125536915'/><link rel='alternate' type='text/html' href='http://saecob.blogspot.com/2011/12/progress-central.html' title='Progress Central'/><author><name>saecob</name><uri>http://www.blogger.com/profile/07787653930456584171</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/-2punVqzf3Aw/Tuas9LRUf3I/AAAAAAAAAAk/3z-YTgiVPE0/s72-c/Transform_Fix.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3962515301035764383.post-5505909669406679880</id><published>2011-12-01T05:05:00.001-08:00</published><updated>2011-12-01T05:14:42.088-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='OpenSource'/><title type='text'>End In Sight</title><content type='html'>So the end of the school term is fast approaching and I am definitely feeling the crunch.&amp;nbsp; I pushed up a new commit to my Github account (&lt;a href="https://github.com/saecob/gladius.math/tree/develop"&gt;https://github.com/saecob/gladius.math/tree/develop&lt;/a&gt;) under the develop branch in preparation for a major pull request for implementations of all Matrix functions.&lt;br /&gt;&lt;br /&gt;Everything seems to be working fine, except for inverse().&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-lclSh1y7fWM/Ttd9CAmIjyI/AAAAAAAAAAc/y2G5goZeWvY/s1600/InverseTest.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="105" src="http://3.bp.blogspot.com/-lclSh1y7fWM/Ttd9CAmIjyI/AAAAAAAAAAc/y2G5goZeWvY/s320/InverseTest.jpg" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;Not exactly sure what is wrong yet but i think i may have missed a movement of some sort with the matrix indexes.&amp;nbsp; Ill take a look at it during the day today.&lt;br /&gt;&lt;br /&gt;Next up: Matrix3 and finally Matrix4 which already has implementations but needs to be brought in line with the API.&lt;br /&gt;Also, I need to change some of the tests for Matrix as the API now states that our functions should accept an array of Matrices which is not being tested as of yet.&lt;br /&gt;&lt;br /&gt;Check back tonight.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3962515301035764383-5505909669406679880?l=saecob.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://saecob.blogspot.com/feeds/5505909669406679880/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://saecob.blogspot.com/2011/12/end-in-sight.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3962515301035764383/posts/default/5505909669406679880'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3962515301035764383/posts/default/5505909669406679880'/><link rel='alternate' type='text/html' href='http://saecob.blogspot.com/2011/12/end-in-sight.html' title='End In Sight'/><author><name>saecob</name><uri>http://www.blogger.com/profile/07787653930456584171</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/-lclSh1y7fWM/Ttd9CAmIjyI/AAAAAAAAAAc/y2G5goZeWvY/s72-c/InverseTest.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3962515301035764383.post-9042650511946933152</id><published>2011-11-27T23:45:00.001-08:00</published><updated>2011-11-27T23:59:25.636-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='OpenSource'/><title type='text'>The Matrix, Is Out There</title><content type='html'>After getting started with the new matrix implementations, having the input parameters as a list of matrices is turning out to be a bit more of a pain than anticipated.&lt;br /&gt;&lt;br /&gt;The main downside is the fact that we now have to iterate through the list of matrices in order to perform add(), subtract(), multiply() on each.&amp;nbsp; We also have to save the results of the previous additions and pass those on for the next set. Something like this:&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-7axv2Y1e6-k/TtM9Ns3XbmI/AAAAAAAAAAU/hCqFT6D7VIQ/s1600/addFunction.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="146" src="http://3.bp.blogspot.com/-7axv2Y1e6-k/TtM9Ns3XbmI/AAAAAAAAAAU/hCqFT6D7VIQ/s320/addFunction.jpg" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;I haven't run any speed tests but this seems like it may be slow, but for now it will have to do.&lt;br /&gt;&lt;br /&gt;Now for my two concerns regarding the API and reality.&lt;br /&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Our add(), subtract(), and multiply() functions all take 2 parameters, &lt;i&gt;&lt;b&gt;ml&lt;/b&gt;&lt;/i&gt;, the list of matrices and &lt;b&gt;&lt;i&gt;result&lt;/i&gt;&lt;/b&gt;, the optional variable in which we will store our result.&amp;nbsp; The API specifies that if the list is only one matrix long then we will return the one matrix.&amp;nbsp; What if the result parameter has values in it and the list only has one matrix? then we will not add the two properly.&amp;nbsp; Maybe this will never happen, ill wait to ask in iRC.&lt;/li&gt;&lt;li&gt;The &lt;i&gt;&lt;b&gt;inverse(m) &lt;/b&gt;&lt;/i&gt;function returns the inverse of the given matrix.&amp;nbsp; A square matrix will only have an inverse if the determinant of that matrix is not zero.&amp;nbsp; This situation is not covered in the api.&lt;/li&gt;&lt;/ol&gt;That is about it for now, going to get these cleared up and then move forward.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3962515301035764383-9042650511946933152?l=saecob.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://saecob.blogspot.com/feeds/9042650511946933152/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://saecob.blogspot.com/2011/11/matrix-is-out-there.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3962515301035764383/posts/default/9042650511946933152'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3962515301035764383/posts/default/9042650511946933152'/><link rel='alternate' type='text/html' href='http://saecob.blogspot.com/2011/11/matrix-is-out-there.html' title='The Matrix, Is Out There'/><author><name>saecob</name><uri>http://www.blogger.com/profile/07787653930456584171</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/-7axv2Y1e6-k/TtM9Ns3XbmI/AAAAAAAAAAU/hCqFT6D7VIQ/s72-c/addFunction.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3962515301035764383.post-5456864125840805658</id><published>2011-11-24T17:47:00.001-08:00</published><updated>2011-11-24T17:54:09.096-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='OpenSource'/><title type='text'>Boys Are Back In Town</title><content type='html'>So I've managed to get myself in gear and get contributing to Math.Gladius again.&amp;nbsp; The math library underwent a massive refactoring in which it was broken down in to small chunks consisting of a script for each size of Vector and Matrix object.&lt;br /&gt;&lt;br /&gt;When I left off, work had been completed to Vector through to Vector4 tests included.&amp;nbsp; Now I am beginning to work on the Matrix functions. There are a few differences in the way we deal with matrices, such as the operation functions (+, -, /, *) taking a list of matrices.&lt;br /&gt;&lt;br /&gt;Check it out: &lt;a href="https://github.com/alankligman/gladius.math/wiki/Math-api-reference"&gt;https://github.com/alankligman/gladius.math/wiki/Math-api-reference&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;I will assume the input is always valid, so from there I'll just have to figure out a clever way of:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Finding out how many Matrices there are in the list&lt;/li&gt;&lt;li&gt;Performing the required operation quickly and efficiently&lt;/li&gt;&lt;/ul&gt;I'll have more later tonight.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3962515301035764383-5456864125840805658?l=saecob.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://saecob.blogspot.com/feeds/5456864125840805658/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://saecob.blogspot.com/2011/11/boys-are-back-in-town.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3962515301035764383/posts/default/5456864125840805658'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3962515301035764383/posts/default/5456864125840805658'/><link rel='alternate' type='text/html' href='http://saecob.blogspot.com/2011/11/boys-are-back-in-town.html' title='Boys Are Back In Town'/><author><name>saecob</name><uri>http://www.blogger.com/profile/07787653930456584171</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3962515301035764383.post-6961785621685327073</id><published>2011-10-04T16:08:00.000-07:00</published><updated>2011-10-04T16:08:45.083-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='OpenSource'/><title type='text'>Equality Among Floats</title><content type='html'>Well the Gladius Math library is coming along swimmingly and is taking shape very quickly now that we have the API outline almost complete.&amp;nbsp; (&lt;a href="https://github.com/alankligman/gladius.math"&gt;https://github.com/alankligman/gladius.math&lt;/a&gt;) Check out the wiki section.&lt;br /&gt;&lt;br /&gt;After implementing the functions for 2 dimensional vectors [x,y] an interesting issue presented itself in the form of one glaring logic error and a unit test case issue.&lt;br /&gt;&lt;ol&gt;&lt;li&gt;In our library we have a function, normalize(v1, result); which returns a unit vector with same direction as the given vector v1.&amp;nbsp; Result is the optional parameter in which we store the resulting vector.&amp;nbsp; Our code for this function was as follows:&lt;/li&gt;&lt;/ol&gt;&lt;blockquote style="background-color: #fff2cc;"&gt;&lt;i&gt;// Return a Vector(result) with same direction as v having unit length&lt;br /&gt;        normalize: function( v, result ) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;            for( var i = 0, len = v.length; i &amp;lt; len; ++ i ) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;                result[i] = v[i] / len;&lt;br /&gt;&amp;nbsp;&amp;nbsp;            }&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;            return result;&lt;br /&gt;        }&lt;/i&gt;&lt;/blockquote&gt;&lt;blockquote&gt;&amp;nbsp;Normalizing a vector is done by calculating its length and dividing each component by the length.&amp;nbsp; At first glance this code looks to be correct but we will quickly see how a small flaw &lt;i&gt;ruins&lt;/i&gt; any results this function returns.&lt;/blockquote&gt;&lt;blockquote&gt;The problem caused by &lt;i style="background-color: #fff2cc;"&gt;len = v.length.&lt;span style="background-color: white;"&gt; &lt;/span&gt;&lt;/i&gt;&lt;span style="background-color: #fff2cc;"&gt;&lt;span style="background-color: white;"&gt;When we use &lt;i&gt;&lt;span style="background-color: #fff2cc;"&gt;v.length&lt;/span&gt;&lt;span style="background-color: white;"&gt; &lt;/span&gt;&lt;/i&gt;&lt;span style="background-color: white;"&gt;it is in fact returning the length of the array holding our vector, in this case [x,y] which would cause the function to just divide components by 2.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/blockquote&gt;&lt;blockquote&gt;By changing the code to&amp;nbsp;&lt;i style="background-color: #fff2cc;"&gt; len = vector.length(v);&lt;/i&gt; we open up the next set of problems.&amp;nbsp; &lt;i&gt;Vector lengths&lt;/i&gt; (&lt;a href="http://en.wikipedia.org/wiki/Euclidean_vector#Length"&gt;http://en.wikipedia.org/wiki/Euclidean_vector#Length&lt;/a&gt;)&lt;/blockquote&gt;&lt;ul&gt;&lt;li&gt;By calculating the absolute length of vectors, some pretty unpleasant numbers can be returned as a result.&amp;nbsp; For example, when we call &lt;span style="background-color: #d9ead3;"&gt;normalize() for the vector v1 = [12,-5]&lt;/span&gt; the &lt;span style="background-color: #d9ead3;"&gt;resulting vector is expressed as v2 = [(12/13), (-5/13)]&lt;/span&gt;.&amp;nbsp; This would not be a problem if a computer were able to show the results as the above expression but of course it can not and it will return a float with a set number of decimals.&lt;/li&gt;&lt;li&gt;This problem is compounded when you start to add other operations on the resulting vector which will continue to use the float representation of the result.&amp;nbsp; This is very evident in the unit tests:&lt;/li&gt;&lt;/ul&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-V37GOjD8swo/TouQ9reLpFI/AAAAAAAAAAQ/jhtDCWT9ZxQ/s1600/TestResult.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="162" src="http://4.bp.blogspot.com/-V37GOjD8swo/TouQ9reLpFI/AAAAAAAAAAQ/jhtDCWT9ZxQ/s320/TestResult.jpg" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&amp;nbsp;You can see above that the expected results and the computed results are identical up until the sixth digit after the decimal.&amp;nbsp; For all intensive purposes this is "equal", we now have to add an equal(v1, v2, e) function which will compare 2 vectors up to a set number of decimals for use to call them equal.&lt;br /&gt;&lt;br /&gt;And that is what i'm working on now, as well as figuring out how to compare only a set number of decimals in the Qunit tests.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3962515301035764383-6961785621685327073?l=saecob.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://saecob.blogspot.com/feeds/6961785621685327073/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://saecob.blogspot.com/2011/10/equality-among-floats.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3962515301035764383/posts/default/6961785621685327073'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3962515301035764383/posts/default/6961785621685327073'/><link rel='alternate' type='text/html' href='http://saecob.blogspot.com/2011/10/equality-among-floats.html' title='Equality Among Floats'/><author><name>saecob</name><uri>http://www.blogger.com/profile/07787653930456584171</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/-V37GOjD8swo/TouQ9reLpFI/AAAAAAAAAAQ/jhtDCWT9ZxQ/s72-c/TestResult.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3962515301035764383.post-8973200326304746436</id><published>2011-10-01T00:12:00.000-07:00</published><updated>2011-10-01T00:12:24.576-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='OpenSource'/><title type='text'>Unit Tests, Love Hate</title><content type='html'>Today I decided to try and get some unit tests created for the matrix functions which I implemented in yesterdays push (&lt;a href="https://github.com/saecob/gladius.math/tree/Matrix2"&gt;https://github.com/saecob/gladius.math/tree/Matrix2&lt;/a&gt;).&lt;br /&gt;&lt;br /&gt;After spending some time identifying how unit tests are launched (index.html),&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;a href="http://2.bp.blogspot.com/-e2zNdUki_eM/Toa3ZUCh6MI/AAAAAAAAAAM/qCBZ2JTqQHs/s1600/LaunchJunitTest.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="160" src="http://2.bp.blogspot.com/-e2zNdUki_eM/Toa3ZUCh6MI/AAAAAAAAAAM/qCBZ2JTqQHs/s320/LaunchJunitTest.jpg" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;I created my own test script with the name Math.Matrix2.js which tests 2 x 2 matrices.&lt;br /&gt;&lt;br /&gt;When I first ran the newly created test, I noticed that none of the coded implementations of any size matrix had been tested.&amp;nbsp; After further inspection, the matrix functions seem to be direct logic and code copies of all the implemented vector functions.&lt;br /&gt;&lt;br /&gt;At first glance this doesn't seem to be such a big problem but I don't think that they correlate exactly.&lt;br /&gt;&lt;br /&gt;The second issue which came about from these discoveries is, that at the moment I feel like I am implementing and adding functions arbitrarily not knowing if they will even be useful to someone using the library.&lt;br /&gt;&lt;br /&gt;For example, we have a function rotate() which creates a rotation matrix given a Quaternion(&lt;a href="http://en.wikipedia.org/wiki/Quaternion"&gt;http://en.wikipedia.org/wiki/Quaternion&lt;/a&gt;). This function is implemented under matrix4 functions, i.e 4x4 matrices.&lt;br /&gt;&lt;br /&gt;The question is: Do we need this function for 2x2 and 3x3 matrices as well?&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size: small;"&gt;&lt;i style="background-color: #d0e0e3; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Construct a 2x2 rotation matrix from a Quaternion.&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; rotate: function() {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if( 0 === arguments.length ) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return Matrix( 4, that.matrix2.identity );&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; } else if( 1 === arguments.length ) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var v = arguments[0];&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var r = v[0];&lt;br /&gt;//&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return Matrix( 4, [] );&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; // Todo (Quaternion = w + xi + yj + zk)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; } else {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return Matrix( 4, arguments );&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; };&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;It seems like it would be a good idea to collaborate with the different areas of the project (Physics, Rendering, etc.) and come up with an interface with a list of functions, parameters, and return types/values so that everything put in Gladius.Math is useful as a library.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3962515301035764383-8973200326304746436?l=saecob.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://saecob.blogspot.com/feeds/8973200326304746436/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://saecob.blogspot.com/2011/10/unit-tests-love-hate.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3962515301035764383/posts/default/8973200326304746436'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3962515301035764383/posts/default/8973200326304746436'/><link rel='alternate' type='text/html' href='http://saecob.blogspot.com/2011/10/unit-tests-love-hate.html' title='Unit Tests, Love Hate'/><author><name>saecob</name><uri>http://www.blogger.com/profile/07787653930456584171</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/-e2zNdUki_eM/Toa3ZUCh6MI/AAAAAAAAAAM/qCBZ2JTqQHs/s72-c/LaunchJunitTest.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3962515301035764383.post-5884455437788860795</id><published>2011-09-29T23:15:00.000-07:00</published><updated>2011-09-30T00:44:12.480-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='OpenSource'/><title type='text'>An Ode To Math</title><content type='html'>Recently I decided to contribute to the Gladius/Paladin (&lt;a href="https://github.com/alankligman/gladius"&gt;https://github.com/alankligman/gladius&lt;/a&gt;) open source project, more specifically, the Gladius.Math(&lt;a href="https://github.com/alankligman/gladius.math"&gt;https://github.com/alankligman/gladius.math&lt;/a&gt;) library.&amp;nbsp; Having only recently decided to get involved with the project, I was feeling a&lt;i&gt; little&lt;/i&gt; overwhelmed but excited as well.&lt;br /&gt;&lt;br /&gt;The issues/tickets I have decided to work on are the implementations of several math functions involving various size matrices and vectors.&lt;br /&gt;&lt;br /&gt;In order to scope this correctly I decided to start with all the functions for 2x2 matrices, then 3x3 and so forth.&amp;nbsp; For each matrix size from 2x2 to 4x4 there are a number of functions which perform various operations, or specifically:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Translate&lt;/li&gt;&lt;li&gt;Scale&lt;/li&gt;&lt;li&gt;Rotate&amp;nbsp;&lt;/li&gt;&lt;/ul&gt;Everyone loves wiki links:&lt;br /&gt;Translations - &lt;a href="http://en.wikipedia.org/wiki/Translation_%28geometry%29"&gt;http://en.wikipedia.org/wiki/Translation_%28geometry%29&lt;/a&gt;&lt;br /&gt;Scaling - &lt;a href="http://en.wikipedia.org/wiki/Scaling_%28geometry%29"&gt;http://en.wikipedia.org/wiki/Scaling_%28geometry%29&lt;/a&gt;&lt;br /&gt;Rotations - &lt;a href="http://en.wikipedia.org/wiki/Rotation_matrix"&gt;http://en.wikipedia.org/wiki/Rotation_matrix&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Also an interesting read: &lt;a href="http://knol.google.com/k/matrices-for-3d-applications-translation-rotation#"&gt;http://knol.google.com/k/matrices-for-3d-applications-translation-rotation#&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;For my first push I implemented these functions for 2x2 matrices.&amp;nbsp; The unit testing will be the next major focus in order to determine performance and test logic.&lt;br /&gt;&lt;br /&gt;Take a look at the code yourself : &lt;a href="https://github.com/saecob/gladius.math/commit/20caebde7578ca3a772440a7bc2b2421740b51e6#L0R548"&gt;https://github.com/saecob/gladius.math/commit/20caebde7578ca3a772440a7bc2b2421740b51e6#L0R548&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;While coding I noticed that there were a number of basic matrix functions which were missing&amp;nbsp; and a number which didn't seem to be present in other math libraries which i used for code examples.&lt;br /&gt;&lt;br /&gt;If I'm going to spend some time with this library I think I'll need to look at some other game engine math libraries to see if there are functions which would help to include.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3962515301035764383-5884455437788860795?l=saecob.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://saecob.blogspot.com/feeds/5884455437788860795/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://saecob.blogspot.com/2011/09/ode-to-math.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3962515301035764383/posts/default/5884455437788860795'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3962515301035764383/posts/default/5884455437788860795'/><link rel='alternate' type='text/html' href='http://saecob.blogspot.com/2011/09/ode-to-math.html' title='An Ode To Math'/><author><name>saecob</name><uri>http://www.blogger.com/profile/07787653930456584171</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3962515301035764383.post-2477050320421140705</id><published>2011-09-29T15:24:00.000-07:00</published><updated>2011-09-29T15:24:07.165-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='OpenSource'/><title type='text'>To Git, Or Not To Git</title><content type='html'>After being introduced to GitHub (&lt;a href="http://www.github.com/"&gt;www.github.com&lt;/a&gt;) a few weeks ago, I thought that things were pretty straight forward and easy to use, that is until you actually start doing some work of course.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;The Git Bash tool, used to communicate with the Git server and to organized your branches and repositories, uses many different commands to do these things which I found very difficult to remember when it came down to working with them. &lt;br /&gt;&lt;br /&gt;Luckily Git provides lots of support and guides to help new users like me along.&amp;nbsp; Here are some which I found helpful.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://help.github.com/"&gt;http://help.github.com/&lt;/a&gt; - The main hub of information on all things Git&lt;br /&gt;&lt;a href="http://help.github.com/git-cheat-sheets/"&gt;http://help.github.com/git-cheat-sheets/&lt;/a&gt; - A compilation of cheat sheets and quick guides to using the bash commands.&lt;br /&gt;&lt;br /&gt;I found these resources very helpful and I thought I would share.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3962515301035764383-2477050320421140705?l=saecob.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://saecob.blogspot.com/feeds/2477050320421140705/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://saecob.blogspot.com/2011/09/to-git-or-not-to-git.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3962515301035764383/posts/default/2477050320421140705'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3962515301035764383/posts/default/2477050320421140705'/><link rel='alternate' type='text/html' href='http://saecob.blogspot.com/2011/09/to-git-or-not-to-git.html' title='To Git, Or Not To Git'/><author><name>saecob</name><uri>http://www.blogger.com/profile/07787653930456584171</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry></feed>
