Wolfram Blog
Theodore Gray

A New Slant in Mathematica

September 3, 2009 — Theodore Gray, Co-founder, Wolfram Research, Inc; Founder, Touch Press; Proprietor, periodictable.com

Longtime Mathematica user Flip Phillips recently sent us this tremendously amusing error message generated by Mathematica. Much as you might think when stumbling upon a pickup truck hanging from a tree, your first reaction is probably, “How does something like that even happen??”

Diagonal error message sent in by Flip Phillps—click to enlarge


The answer is powerful, integrated design. An error message like this is possible only in a system that deeply integrates graphical and symbolic environments, and goes to great lengths to ensure that everything that ought to work, does work.

Flip, unfortunately, did not save anything but a screen shot of the error, so we may never know the exact details of what happened, but it’s not hard to figure out that a Rotate function was involved.

Rotate is a wrapper that makes a lot of sense in the context of graphics. For example, you can rotate a rectangle:

Graphics[Rotate[Rectangle[{0, 0}, {1, 1}], π/6]]

Rotated rectangle

You can even make a little slider interface to rotate it by different amounts:

Manipulate[Graphics[Rotate[Rectangle[{0, 0}, {1, 1}], Θ]], {Θ, 0, 2 π}]

To see this content, you need a recent version of Adobe's Flash Player.
Get the latest Flash Player.

But there’s no fundamental reason why Rotate shouldn’t work on everything, including text and mathematical expressions completely outside the context of graphics. And in Mathematica, we try to ensure that if something should work, it does work, because you just never know when it might come in handy.

So for example you can rotate the result of an integration:

Rotate[Integrate[1/(1 - x^3), x], π/4]

Rotated integration results

The implementation of Rotate, and similar formatting constructs, is deep and complete. Rotated objects, for example, are perfectly acceptable as variable names:

Apart[1/(1 - Rotate[bob, 3 Pi/4]^9)]

Output with rotated variable names

Yes of course you can make an interactive version of that too:

Manipulate[Apart[1/(1 - Rotate[bob, Θ]^9)], {Θ, 0, 2 π}]

To see this content, you need a recent version of Adobe's Flash Player.
Get the latest Flash Player.

Clearly what happened in the case of this error message is something along these lines:

Rotate[RandomReal[100, {15, 15}], 3 Pi/4]

Rotated block of RandomReal results

Seen in this context, there’s really no mystery: this is simply an error message generated in the course of working with rotated objects, perhaps a raster image meant to go inside a graphics object (which would explain the 2D array of numbers).

What the pickup truck is doing in the tree you will have to figure out on your own.

Posted in: Mathematica News
Leave a Comment

21 Comments


Mike

It may be a cool bug, but I think you’d still have to say it’s a bug…

Posted by Mike    September 3, 2009 at 11:35 pm
Satish S Nandihalli

I donot know mathematica …. I wish i knew mathematica, … amazing programming language …..

Posted by Satish S Nandihalli    September 4, 2009 at 1:03 am
Theodore Gray

Well, yes it’s a bug, but it’s a bug in Flip’s Mathematica code, not a bug in Mathematica itself. Flip wrote some kind of program in Mathematica which is probably trying to display a rotated raster, but he made a mistake in his code, which correctly caused Mathematica to display this error message.

Posted by Theodore Gray    September 4, 2009 at 10:45 am
wayne

quote:
“but he made a mistake in his code, which correctly caused Mathematica to display this error message”

:), hoho ,a little tricky

Posted by wayne    September 5, 2009 at 12:39 pm
video izle

Yes, good idea. Thanks a lot

Posted by video izle    September 6, 2009 at 9:03 am
Maynard Handley

The “powerful, integrated design” is a great idea — I only wish Mathematica actually took it more seriously.

While I can Rotate[] everything, I can’t even Translate[] one lousy Plot relative to another.
While I can Show[] multiple 2D plots, I can’t Show[] a 2D plot along with a 3D plot.
While I can create variables using subscripts and superscripts that superficially look like their mathematical counterparts, the illusion falls apart as soon as I try anything sophisticated, because they are constructed via a mechanism completely unlike the way “standard” symbols are constructed in Mathematica.

How about the goal for Mathematica 7.1 be the CONSISTENCY edition?

Posted by Maynard Handley    September 8, 2009 at 8:50 am
Armand Tamzarian

Maynard are you using Symbolize to create your sub and super scripted symbols?

Posted by Armand Tamzarian    September 9, 2009 at 8:45 am
Steve Zimmerman

Could Mathematica violate the Heisenberg Uncertainty Principle? IOW, could Mathematica create code that would accurately render (in visible scale) the behavior of subatomic particles?

Posted by Steve Zimmerman    September 10, 2009 at 12:47 pm
hikayeler

Thanks a lot.Good information

Posted by hikayeler    October 2, 2009 at 1:37 pm
Ramy Mohamed

I’m also find it frustrating sometimes when I try things and it does not work, but I find it always my fault not Mathematica’s developers.
TRY HARDER Maynard

Posted by Ramy Mohamed    October 6, 2009 at 2:17 pm
Sandeep Kumar Rana

It was nice,thanks for making mistake in code. ho.ho..ho………!

Posted by Sandeep Kumar Rana    November 20, 2009 at 11:45 am
Jorge Gamaliel Frade Chávez

Mathematica is nice, Mathematica is like woman, you must to write very very nice in order to make many things

Posted by Jorge Gamaliel Frade Chávez    January 29, 2010 at 9:49 pm
kırlangıç bayrak

thank you so much

Posted by kırlangıç bayrak    February 4, 2010 at 4:44 am
Duraid

Found this page after searching for mathematica 7.1, which I will need because 7.0.1 is a buggy turd. :(

Posted by Duraid    March 11, 2010 at 12:38 am
bayrak

Congratulations !
Very very nice site
Thank you.

Posted by bayrak    March 13, 2010 at 8:27 am
hikaye

Thanks a lot.Good information.

Posted by hikaye    March 30, 2010 at 10:53 pm
takı

thanks admin…

Posted by takı    June 15, 2010 at 3:27 am
hikaye

Good information

Posted by hikaye    August 3, 2010 at 6:41 pm
Daniel

I second Maynard. When can we Scale[bob,{0,0.5}]? Try flipping a complicated graphics object over the x-axis and then talk to me about deeply integrated systems.

Posted by Daniel    February 9, 2011 at 4:21 pm
promosyon

Your site is very good. There are useful information and most importantly, for sharing great. Thank you.

Posted by promosyon    April 22, 2011 at 6:34 am
inci

is the math invented or discovered? :)

Posted by inci    July 27, 2011 at 9:02 am


Leave a comment

Loading...

Or continue as a guest (your comment will be held for moderation):