+ Reply to Thread
Results 1 to 4 of 4

Create a line through two points and with a certain slope at each point. Freeform maybe?

  1. #1
    Forum Expert
    Join Date
    09-01-2012
    Location
    Norway
    MS-Off Ver
    Office 365
    Posts
    2,883

    Create a line through two points and with a certain slope at each point. Freeform maybe?

    Well, the title pretty much says it all. I want a curved line from point A to point B and then I want to be able to set the slope at each end. Point A and B are known ofcourse and I assume the curve will be some sort of polynomial thing. It's for visualizing a pump impeller if anyone wonders. If anyone comes up with the maths I will use that to draw it in a chart.

    I totally recall this was some of the tasks I solved at university many years ago, most likely as a part of a Numerical Methods course or something. Now my knowledge has been reduced to just knowing it exists.
    This is a excellent Excel forum and not a maths forum but I'm a bit lazy. If anyone know of another forum that can deal with these kind of questions that would be cool too.

    The Freeform Shape kind of does what I want but the fact that you not only set the slope but how much that slope affects the rest of the curve put me of a bit. Also it was not so easy to work with. The Freeform might not be my first choice (I think) but if anyone can pull a freeform shape VBA solution out of a hat I would jump up and down of joy.
    <----- If you were helped by my posts you can say "Thank you" by clicking the star symbol down to the left

    If the problem is solved, finish of the thread by clicking SOLVED under Thread Tools
    I don't wish to leave you with no answer, yet I sometimes miss posts. If you feel I forgot you, remind me with a PM or just bump the thread.

  2. #2
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP, 2007, 2024
    Posts
    16,375

    Re: Create a line through two points and with a certain slope at each point. Freeform mayb

    What you are describing sounds to me like you are trying to create a "spline" -- a common way to connect points with a smooth curve. The most common choice is a cubic equation (http://en.wikipedia.org/wiki/Spline_interpolation) (http://en.wikipedia.org/wiki/Cubic_spline) I expect that was what you did back in university. Review Wikipedia and other sources talking about cubic splines and how to create them.

    Specific to your case, it sounds like it should boil down to a system of 4 equations in 4 unkowns (using a cubic polynomial):

    1) yA=a*xA^3+b*xA^2+c*xA+d
    2) yA'=3*a*xA^2+2*b*xA+c
    3) yB=same as yA
    4) yB'=same as yA'

    From there, set it up into a suitable matrix and use matrix algebra to solve the system of equations (You can use the built in MMULT and/or MINVERSE() functions to perform the matrix manipulations in Excel http://office.microsoft.com/en-us/ex...in=HP010342656). If you need a quick refresher on solving these, there should be several tutorials on the net for setting these up. Let us know if you need further help.
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  3. #3
    Forum Expert
    Join Date
    09-01-2012
    Location
    Norway
    MS-Off Ver
    Office 365
    Posts
    2,883

    Re: Create a line through two points and with a certain slope at each point. Freeform mayb

    There is nothing wrong with your hearing, spline is what I'm looking for!
    Good stuff, I will look into this now and return later with more questions.

  4. #4
    Forum Expert
    Join Date
    09-01-2012
    Location
    Norway
    MS-Off Ver
    Office 365
    Posts
    2,883

    Re: Create a line through two points and with a certain slope at each point. Freeform mayb

    I think I solved it. Thanks!
    Attached Files Attached Files

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Calculating Slope and Intercept with a changing number of data points
    By WE5T in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 09-10-2013, 05:48 AM
  2. slope of a set of points
    By jcody in forum Excel General
    Replies: 3
    Last Post: 09-20-2012, 10:10 AM
  3. Replies: 2
    Last Post: 06-27-2011, 10:47 PM
  4. [SOLVED] How to create drop down menu for freeform objects?
    By DORI in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-16-2006, 11:10 AM
  5. Slope of a Trend Line
    By jpx in forum Excel General
    Replies: 1
    Last Post: 04-24-2006, 06:10 PM

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1