Matrix addition/subtraction component in math tab returns error - Grasshopper2019-09-18T01:47:31Zhttps://www.grasshopper3d.com/forum/topics/matrix-addition-subtraction-component-in-math-tab-returns-error?commentId=2985220%3AComment%3A1771073&feed=yes&xn_auth=nohttps://xkcd.com/605/
In GH2…tag:www.grasshopper3d.com,2017-06-20:2985220:Comment:17719452017-06-20T20:41:58.995ZMateusz Zwierzyckihttps://www.grasshopper3d.com/profile/MateuszZwierzycki
<p><a href="https://xkcd.com/605/" target="_blank">https://xkcd.com/605/</a></p>
<p></p>
<blockquote><p><span>In GH2 data conversion is not a binary success/failure operation any more, conversions fall on a sliding scale from </span><em>'direct'</em><span>, via </span><em>'straightforward'</em><span>, to </span><em>'reasonable'</em><span>, stopping briefly at </span><em>'exotic'</em><span> eventually to end up in </span><em>'farfetched'.</em></p>
</blockquote>
<p>Thats like... 5 different…</p>
<p><a href="https://xkcd.com/605/" target="_blank">https://xkcd.com/605/</a></p>
<p></p>
<blockquote><p><span>In GH2 data conversion is not a binary success/failure operation any more, conversions fall on a sliding scale from </span><em>'direct'</em><span>, via </span><em>'straightforward'</em><span>, to </span><em>'reasonable'</em><span>, stopping briefly at </span><em>'exotic'</em><span> eventually to end up in </span><em>'farfetched'.</em></p>
</blockquote>
<p>Thats like... 5 different component colors (+white). You better get some nice, colorblind-friendly charts ;)</p>
<p></p>
<p>I'm not sure how much I <span class="gt-card-ttl-txt">fetishize the "traditional" and ".NET" syntax over user-friendliness. On one hand, some of those ideas seem like a blasphemy, on the other hand... that's what was the GH about, right ? </span></p>
<p></p>
<blockquote><p><span class="gt-card-ttl-txt"><span>Furthermore the user will be able to specify what level triggers warnings, so that expert users can use weird conversions without getting confronted with visual clutter whilst teachers can insist on a low threshold.</span></span></p>
<p></p>
</blockquote>
<p><span class="gt-card-ttl-txt"><span>Sounds cool, a bit like Option Strict. Can we have a "hardcore" mode which simply disables all the castings and requires the user to cast explicitly ?</span></span></p> Great work David! can't wait…tag:www.grasshopper3d.com,2017-06-19:2985220:Comment:17715122017-06-19T18:25:19.908ZGavinhttps://www.grasshopper3d.com/profile/Randy
<p>Great work David! can't wait to try it out. I am hoping to develop an exposed matrix transformation process.</p>
<p></p>
<p></p>
<p>Regards,</p>
<p>Gavin</p>
<p>Great work David! can't wait to try it out. I am hoping to develop an exposed matrix transformation process.</p>
<p></p>
<p></p>
<p>Regards,</p>
<p>Gavin</p> I'm excited about GH2. You gu…tag:www.grasshopper3d.com,2017-06-19:2985220:Comment:17712642017-06-19T18:23:44.717ZOliver Brossmannhttps://www.grasshopper3d.com/profile/OliverBrossmann
<p>I'm excited about GH2. You guys are close to releasing right? ;)</p>
<p>I'm excited about GH2. You guys are close to releasing right? ;)</p> I think it would be silly to…tag:www.grasshopper3d.com,2017-06-19:2985220:Comment:17712632017-06-19T18:15:46.667ZDavid Ruttenhttps://www.grasshopper3d.com/profile/DavidRutten
<p>I think it would be silly to talk of a 'majority of people' considering there will probably be about seven (eleven at the utmost) people who will ever want to do arithmetic on matrices :)</p>
<p></p>
<p>But you're right of course, some of these operations are not at all standard and not at all predictable or memorable. When this new approach is transferred to GH2, I think I'd very much like to add some system of warnings which tells you when a particular arithmetic operation is pretty darn…</p>
<p>I think it would be silly to talk of a 'majority of people' considering there will probably be about seven (eleven at the utmost) people who will ever want to do arithmetic on matrices :)</p>
<p></p>
<p>But you're right of course, some of these operations are not at all standard and not at all predictable or memorable. When this new approach is transferred to GH2, I think I'd very much like to add some system of warnings which tells you when a particular arithmetic operation is pretty darn exotic, say matrix/matrix, or colour*vector, or point-boolean.</p>
<p></p>
<p>I want to provide as rich a feature set as possible, but we must be careful to help users avoid pitfalls that make the program behave in frustratingly obscure ways.</p>
<p></p>
<p>Good news is that this seems to be a very similar problem to automatic data conversion issues, which I have already written. In GH2 data conversion is not a binary success/failure operation any more, conversions fall on a sliding scale from <em>'direct'</em>, via <em>'straightforward'</em>, to <em>'reasonable'</em>, stopping briefly at <em>'exotic'</em> eventually to end up in <em>'farfetched'</em>. Furthermore the user will be able to specify what level triggers warnings, so that expert users can use weird conversions without getting confronted with visual clutter whilst teachers can insist on a low threshold.</p> While I agree with you guys o…tag:www.grasshopper3d.com,2017-06-19:2985220:Comment:17710832017-06-19T07:51:15.461ZMateusz Zwierzyckihttps://www.grasshopper3d.com/profile/MateuszZwierzycki
<p>While I agree with you guys over multiplication, addition and subtraction, I think division as you're proposing is a bit convoluted. I don't think that in general replacing one operator "/" with "* ^-1" is a good coding practice. Not sure if "a good coding practice" is a valid argument... </p>
<p></p>
<p>EDIT: </p>
<p>Two cases possible: </p>
<p>1. Majority of people assume "/" is "* ^-1"... everything is fine and everybody is happy about it.</p>
<p>2. Majority of people assume "/" means…</p>
<p>While I agree with you guys over multiplication, addition and subtraction, I think division as you're proposing is a bit convoluted. I don't think that in general replacing one operator "/" with "* ^-1" is a good coding practice. Not sure if "a good coding practice" is a valid argument... </p>
<p></p>
<p>EDIT: </p>
<p>Two cases possible: </p>
<p>1. Majority of people assume "/" is "* ^-1"... everything is fine and everybody is happy about it.</p>
<p>2. Majority of people assume "/" means matrix division is possible, who knows what does it result with... </p> also, matrix division doesn't…tag:www.grasshopper3d.com,2017-06-19:2985220:Comment:17710732017-06-19T06:34:36.609ZDavid Ruttenhttps://www.grasshopper3d.com/profile/DavidRutten
<blockquote><span>also, matrix division doesn't exist which makes it even worse.</span></blockquote>
<p></p>
<p><span>There's various operations that are already different between addition and multiplication. Sometimes an operation makes sense on some data types, sometimes it doesn't. I'm aiming to support all those that do. On the other hand, if scalar division (A/B) equals (A * B^-1), then why wouldn't matrix division be A*B^-1, i.e. matrix multiplication with the inverse of the second…</span></p>
<blockquote><span>also, matrix division doesn't exist which makes it even worse.</span></blockquote>
<p></p>
<p><span>There's various operations that are already different between addition and multiplication. Sometimes an operation makes sense on some data types, sometimes it doesn't. I'm aiming to support all those that do. On the other hand, if scalar division (A/B) equals (A * B^-1), then why wouldn't matrix division be A*B^-1, i.e. matrix multiplication with the inverse of the second operand?</span></p> Yes, I've implemented it as e…tag:www.grasshopper3d.com,2017-06-19:2985220:Comment:17708082017-06-19T06:28:29.973ZDavid Ruttenhttps://www.grasshopper3d.com/profile/DavidRutten
<p>Yes, I've implemented it as entry-wise sum. There's other kinds of matrix addition, but they seem too exotic to make the default behaviour.</p>
<p>Yes, I've implemented it as entry-wise sum. There's other kinds of matrix addition, but they seem too exotic to make the default behaviour.</p> Yes I meant as matrix operato…tag:www.grasshopper3d.com,2017-06-18:2985220:Comment:17706702017-06-18T06:03:06.927ZGil Alsberghttps://www.grasshopper3d.com/profile/GilAlsberg
<p>Yes I meant as matrix operator: actualy addition and subtraction are both together depnding on the elements signs (part or all of the elements are added and part or all of the elements are subtracted. dimension of matrices must be identical) and division is the same as multiplication (dimension must be in the order of A(mxn)*\/B(nxk) where n is the common dimension): to divide one element by another you just multiply it by 1/value (part or all of the elements can multiply while part or all…</p>
<p>Yes I meant as matrix operator: actualy addition and subtraction are both together depnding on the elements signs (part or all of the elements are added and part or all of the elements are subtracted. dimension of matrices must be identical) and division is the same as multiplication (dimension must be in the order of A(mxn)*\/B(nxk) where n is the common dimension): to divide one element by another you just multiply it by 1/value (part or all of the elements can multiply while part or all of the elements divide):</p>
<p>so for example matrix addition of matrices A(2x2): {2,-1}{1,2} and B(2,2): {3,-5}{4,-2} will result in matrix C(2x2):{5,-6}{5,0}. subtraction of those matrices will result in D(2x2): {-1,4}{-3,4}</p>
<p></p>
<p>Division of matrices A(2x2): {2,0.5}{2,4} and B(2x1) :{2}{2} will result in matrix C(2x1): {1+0.25}{1+2}={1.25,3}. Multiplication of those matrices will result in D(2x1):{4+1}{4+8}={5,12}.</p> Do you want to implement thos…tag:www.grasshopper3d.com,2017-06-17:2985220:Comment:17703162017-06-17T10:25:31.023ZMateusz Zwierzyckihttps://www.grasshopper3d.com/profile/MateuszZwierzycki
<p>Do you want to implement those as per-matrix-element operator ? This can become confusing, especially with multiplication... also, matrix division doesn't exist which makes it even worse.</p>
<p>Do you want to implement those as per-matrix-element operator ? This can become confusing, especially with multiplication... also, matrix division doesn't exist which makes it even worse.</p> Thats great to hear! looking…tag:www.grasshopper3d.com,2017-06-17:2985220:Comment:17703012017-06-17T09:00:17.654ZGil Alsberghttps://www.grasshopper3d.com/profile/GilAlsberg
<p>Thats great to hear! looking forward to see this. Have a nice weekend</p>
<p>Thats great to hear! looking forward to see this. Have a nice weekend</p>