-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fixed transformVec, oneLineSummary #2
base: master
Are you sure you want to change the base?
Conversation
I think the change to transformVec is wrong: transformVec: (a) ->
# transforms a 2-item array in place
@transformPair(a[0], a[1]) It wouldn't change it "in place" as the function is supposed to do. Here's the original: transformVec: (a) ->
# transforms a 2-item array in place
t0 = @m00 * a[0] + @m01 * a[1] + @v0
t1 = @m10 * a[0] + @m11 * a[1] + @v1
a[0] = t0
a[1] = t1 If you want it to return the modified array, you could add one more line to the bottom setting the return value to the input. |
yes i know. I tried it again and now it works, don't know what I missed first. |
now its again in place and the summery is fixed. |
@@ -64,8 +64,8 @@ class affine2d | |||
" #{@m11.toPrecision(3)}] V = (" + | |||
"#{@v0.toPrecision(3)}, " + | |||
" #{@v1.toPrecision(3)}) scale = " + | |||
@getXScale().toPrecision(3) + " x " + | |||
@getYScale().toPrecision(3) | |||
@getXCenter().toPrecision(3) + " x " + |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm a little confused about this change. The printout says "scale = " and then it was previously printing getXScale()
and getYScale()
, but after your change it says "scale =" and then prints the center. Can you explain?
There is no function getXScale(), so I thought it was a typo. But now I think its unnecessary or rather not possible to print the scale from the matrix. Wouldn't it be better to leave the printing of the scale? |
No description provided.