Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 439961
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T20:49:31+00:00 2026-05-12T20:49:31+00:00

I have a set of isoline points (or contour points) such as this: Each

  • 0

I have a set of isoline points (or contour points) such as this:

enter image description here

Each point on an isoline has its own respective X, Y, and Z coordinate. Since they are isolines, that means that each point will have a unique X-Y pair, but points on the same line will have the same Z coordinate.

Now, is there any algorithm or any software packages (either in C# or C++ or MATLAB) that I can use to interpolate the isoline points into a full 3-D surface?

P/S: I am not just interested in the final output, I am interested in getting the interpolated surface data so that I can plot the surface myself.

Edit: C++ solutions are welcomed as well.

  • 1 1 Answer
  • 1 View
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T20:49:32+00:00Added an answer on May 12, 2026 at 8:49 pm

    In MATLAB you can use either the function griddata or the TriScatteredInterp class (Note: as of R2013a scatteredInterpolant is the recommended alternative). Both of these allow you to fit a surface of regularly-spaced data to a set of nonuniformly-spaced points (although it appears griddata is no longer recommended in newer MATLAB versions). Here’s how you can use each:

    • griddata:

      [XI,YI,ZI] = griddata(x,y,z,XI,YI)
      

      where x,y,z each represent vectors of the cartesian coordinates for each point (in this case the points on the contour lines). The row vector XI and column vector YI are the cartesian coordinates at which griddata interpolates the values ZI of the fitted surface. The new values returned for the matrices XI,YI are the same as the result of passing XI,YI to meshgrid to create a uniform grid of points.

    • TriScatteredInterp class:

      [XI,YI] = meshgrid(...);
      F = TriScatteredInterp(x(:),y(:),z(:));
      ZI = F(XI,YI);
      

      where x,y,z again represent vectors of the cartesian coordinates for each point, only this time I’ve used a colon reshaping operation (:) to ensure that each is a column vector (the required format for TriScatteredInterp). The interpolant F is then evaluated using the matrices XI,YI that you must create using meshgrid.

    Example & Comparison

    Here’s some sample code and the resulting figure it generates for reconstructing a surface from contour data using both methods above. The contour data was generated with the contour function:

    % First plot:
    
    subplot(2,2,1);
    [X,Y,Z] = peaks;  % Create a surface
    surf(X,Y,Z);
    axis([-3 3 -3 3 -8 9]);
    title('Original');
    
    % Second plot:
    
    subplot(2,2,2);
    [C,h] = contour(X,Y,Z);  % Create the contours
    title('Contour map');
    
    % Format the coordinate data for the contours:
    
    Xc = [];
    Yc = [];
    Zc = [];
    index = 1;
    while index < size(C,2)
      Xc = [Xc C(1,(index+1):(index+C(2,index)))];
      Yc = [Yc C(2,(index+1):(index+C(2,index)))];
      Zc = [Zc C(1,index).*ones(1,C(2,index))];
      index = index+1+C(2,index);
    end
    
    % Third plot:
    
    subplot(2,2,3);
    [XI,YI] = meshgrid(linspace(-3,3,21));  % Generate a uniform grid
    ZI = griddata(Xc,Yc,Zc,XI,YI);          % Interpolate surface
    surf(XI,YI,ZI);
    axis([-3 3 -3 3 -8 9]);
    title('GRIDDATA reconstruction');
    
    % Fourth plot:
    
    subplot(2,2,4);
    F = TriScatteredInterp(Xc(:),Yc(:),Zc(:));  % Generate interpolant
    ZIF = F(XI,YI);                             % Evaluate interpolant
    surf(XI,YI,ZIF);
    axis([-3 3 -3 3 -8 9]);
    title('TriScatteredInterp reconstruction');
    

    enter image description here

    Notice that there is little difference between the two results (at least at this scale). Also notice that the interpolated surfaces have empty regions near the corners due to the sparsity of contour data at those points.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have set of flat files (114 files) each file is named with database
I have set of images within UL like this : <ul> <li> <a href=#>
I have set of Jquery-UI-Tabs which contains a save button for each tab. I
I have set the eclipse java formatter to wrap lines that exceed 120 characters
I have set a background on the data-role=page element like so <div data-role=page style=background:
I have set up Eclipse Indigo to do line debugging with CFEclipse over port
I have set up upload_max_filesize and post_max_size to 32Mb in php.ini. I am using
I have set the AutoSize property of the form to True and I have
I have set up an app that is registered for remote notifications. - (void)application:(UIApplication*)application
we have set up CDH4 (hdfs, hbase, hue, mapreduce, oozie and zookeeper) on a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.