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

  • Home
  • SEARCH
  • 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 8589347
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T23:02:01+00:00 2026-06-11T23:02:01+00:00

I am not getting the desired 2D linear interpolation functionality with LinearNDInterpolator. The following

  • 0

I am not getting the desired 2D linear interpolation functionality with LinearNDInterpolator. The following piece of code is trying to do an interpolation between the 4 knot points (0,0), (1,0), (0,1), (1,1). interp2d gives me the expected (linear-interpolated) result but LinearNDInterpolator is doing something else, which I am unable to figure out. Perhaps I am not using the API correctly. Unfortunately, I can’t find detailed docs on the usage. Can someone please help or point me to the right forum (mathoverflow ?) to write to ?

>>> f = interp2d([0,1,0,1], [0,0,1,1], [0,1,2,4])
>>> f(0.5,0.5)
array([ 1.75])
>>> g = LinearNDInterpolator([[0,0],[1,0],[0,1],[1,1]], [0,1,2,4])
>>> g(0.5,0.5)
array(2.0)
  • 1 1 Answer
  • 0 Views
  • 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-06-11T23:02:02+00:00Added an answer on June 11, 2026 at 11:02 pm

    From http://docs.scipy.org/doc/scipy/reference/generated/scipy.interpolate.LinearNDInterpolator.html:

    The interpolant is constructed by triangulating the input data with Qhull [R15], and on each triangle performing linear barycentric interpolation.

    In your case, the triangles chosen appear to share the (0,0), (1,1) edge. Since (0.5, 0.5) is midway between (0,0) and (1,1), the interpolated value lies between the values at those vertices, so it is (0+4)/2 = 2.0.

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

Sidebar

Related Questions

I'm a novice in JQuery, I'm trying some simple code but not getting the
I'm building this function but I'm not getting the desired output, it's been more
I'm not getting any anti-aliasing when using drawing GL_TRIANGLE_FANs with this code: glDisable(GL_DEPTH_TEST); //
This should be simple Im just not getting the desired result, i've tries this
I am trying to integrate Paypal and I am not getting the things right.When
I not getting the desired effect from a script. I want the password to
SQL. I have created 1 procedure but I am not getting the desired output.
Really simple but just not getting it. I want to reference a view by
I am not getting that how to differentiate same element name for eg City,Area
I am not getting any error message in browser due to curly brace missing

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.