CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    May 2003
    Location
    Jodhpur -> Rajasthan -> INDIA
    Posts
    453

    How to plot contours using radial cordinates?

    Hello

    I want to plot contours with radial cordinates i.e. THETA (angle value) and radius value (distance vale) around a point.

    I will be having values in following format:

    THETA DISTANCE VALUE

    NOW i need to plot contours. HOW to proceed?

    I am new to SWING or AWT, please guide me how to start?

    Sandeep Arya
    Leave Your Mark Wherever You Go
    http://www.danasoft.com/sig/d0153030Sig.jpg

  2. #2
    Join Date
    Apr 2003
    Location
    Los Angeles area
    Posts
    776

    Re: How to plot contours using radial cordinates?

    I don't know if there is a plotting method in the java api for polar coordinates. I want to think I saw one but here is the formula for converting between.
    Code:
    // polar to Cartesian
    double x = Math.cos( angleInRadians ) * radius;
    double y = Math.sin( angleInRadians ) * radius;
    
    // Cartesian to polar.
    double radius = Math.sqrt( x * x + y * y );
    double angleInRadians = Math.acos( x / radius );
    "The Chicken and Rice MRE is not a personal lubricant."

  3. #3
    Join Date
    May 2003
    Location
    Jodhpur -> Rajasthan -> INDIA
    Posts
    453

    Re: How to plot contours using radial cordinates?

    Thanks a lot for feedback.

    Well what about the next step i.e. HOW TO PLOT CONTOURS?

    I am interested in plotting 2D contours only either line contour or colour contour.


    Sandeep
    Leave Your Mark Wherever You Go
    http://www.danasoft.com/sig/d0153030Sig.jpg

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured