Graphics with Mathematica: How long will it take for me to learn it?

Discussion in 'Programming' started by M&M's are ok, Dec 24, 2006.

  1. #1
    Hello,

    I would like to ask how long will it take me, a math major, to learn how to produce graphics using mathemtica?

    Thanks.
     
    M&M's are ok, Dec 24, 2006 IP
  2. Senpai IT

    Senpai IT Active Member

    Messages:
    453
    Likes Received:
    43
    Best Answers:
    0
    Trophy Points:
    68
    #2
    It took me 3 years in the university to learn only math analysis. You will need that one.
    Then you will have to learn how to implement math functions into the pixel coordinates on the PC screen.
    For the simple graphics built in XY axis, you can use something like such calculations:

    y=2*x+3 (exapmle linear function)
    What you basically need to do is to get proper Y pixel coordinate for each X pixel coordinate.
    Another issue is that the coordinates on PC screen start counting from top-left corner, so you need to invert the Y-axis.
    In PHP or any other C-like language that would look smth like the following code:

    $SCREEN_HEIGHT = 700;
    $SCREEN_WIDTH = 700;
    for ($x = 0; $x < $SCREEN_WIDTH; $x++)
     {
       $y = 2 * $x + 3;
       $coord_Y = $SCREEN_HEIGHT - $y;
       $coodx_X = $x;
       // here put a function that displays a pixel with the screen coordinates $cood_X and $coord_Y
     }
    PHP:
    That is a very simple, very basic code, just to give you an idea. You will need to check that pixels are not going outside the canvas (in my example they do for $x>=349).

    You can also scale the graphics, that is a home work for you to get how to do so :)
     
    Senpai IT, Dec 25, 2006 IP