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 7827845
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T10:04:00+00:00 2026-06-02T10:04:00+00:00

I’m making just a basic application that just writes pixels along a curve in

  • 0

I’m making just a basic application that just writes pixels along a curve in C#.

I came across this website with a formula that looks promising. I believe this website is also talking about the same thing here.

What I don’t really understand is how to implement it. I tried looking at the JavaScript code on the first link but I can’t really tell what data I need to supply. The things involving the PVC, PVI, or PVT are the things I don’t understand.

The example situation I’m going to set up is just both of the grades (vertical incline/decline) is just 5 and -5. Let’s say point 1 is at 0, 0 and point 2 is 100, 100.

Can someone explain some of the obscure variables in the formula and how would I use the formula to draw the curve?

  • 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-02T10:04:01+00:00Added an answer on June 2, 2026 at 10:04 am

    Generally, to draw a curve in 2D you vary one parameter, and then collect x,y point pairs, and plot the pairs. In your case it will work to just vary the horizontal distance (x), and then collect the corresponding y-values, and then you can plot these.

    As for the formula, it is very unclear. Basically it’s just a parabola with a bunch of (poorly defined) jargon around it. To graph this, you want to vary x from 0 to L (this isn’t obvious, btw, I had to work out the math, i.e., how to vary x so that the slopes would be as they suggest in the figure, anyway, it’s 0 to L, and they should have said so).

    I don’t have C# running now, but hopefully you can translate this Python code:

    from matplotlib.pyplot import plot, show
    from numpy import arange
    
    G1 = .1 # an initial slope (grade) of 10%  (note that one never uses percentages directly in calculations, it's always %/100)
    G2 = -.02 # a final slope (grade) of 2%
    c = 0    # elevation (value of curve when x=0, that is, y at PVC
    L = 10.   # the length of the curve in whatever unit you want to use (ft, m, mi, etc), but this basically sets your unit system
    N = 1000  # I'm going to calculate and plot 100 points to illustrate this curve
    
    x = arange(0, L, float(L)/N)  # an array of N x values from 0 to (almost) L
    
    # calculate the curve
    a = (G2-G1)/(2*L)
    b = G1
    y = a*x*x + b*x + c  # this is shorthand for a loop y[0]=a*x[0]*x[0] + b*...
    
    plot(x, y)    
    show()
    
    print (y[1]-y[0])/(x[1]-x[0]), (y[-1]-y[-2])/(x[-1]-x[-2])
    

    The final line prints the initial and final slopes as a check (in Python neg indexing counts from the back of the array), and this match what I specified for G1 and G2. The plot looks like:

    enter image description here

    As for your requests: “The example situation I’m going to set up is just both of the grades (vertical incline/decline) is just 5 and -5. Let’s say point 1 is at 0, 0 and point 2 is 100, 100.”, in a parabola you basically get three free parameters (corresponding to a, b, and c), and here, I think, you over-specified it.

    What are PVC, PVT, and PVI? PVC: the starting point, so Y_PVC is the height of the starting point. PVT: the ending point. PVI: if you draw a line from PVC at the initial slope G1 (ie the tangent to the curve on the left), and similarly from PVT, the point where they intersect is called PVI (though why someone would ever care about this point is beyond me).

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

Sidebar

Related Questions

I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
For some reason, after submitting a string like this Jack’s Spindle from a text
I used javascript for loading a picture on my website depending on which small
this is what i have right now Drawing an RSS feed into the php,
I've got a string that has curly quotes in it. I'd like to replace
I have this code to decode numeric html entities to the UTF8 equivalent character.

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.