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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T11:20:10+00:00 2026-05-12T11:20:10+00:00

Okay, so this is a straight math question and I read up on meta

  • 0

Okay, so this is a straight math question and I read up on meta that those need to be written to sound like programming questions. I’ll do my best…

So I have graph made in flot that shows the network usage (in bytes/sec) for the user. The data is 4 minutes apart when there is activity, and otherwise set at the start of the usage range (let’s say day 1) and the end of the range (day 7). The data is coming from a CGI script I have no control over, so I’m fairly limited in what I can provide the user.

I never took trig or calculus, so I’m pretty much in over my head. What I want is for the user to have the option to click any point on the graph and see their bandwidth usage for that moment. Since the lines between real data points are drawn straight, this can be done by getting the points before and after where the user has clicked and finding the y-interval.

It took me weeks to finally get a helpful math person to explain this to me. Everyone else has insisted on trying to teach me Riemann sum techniques and all sorts of other heavy stuff that not only is confusing to me, doesn’t seem necessary for the problem.

But I also want the user to be able to highlight the graph from two arbitrary points on the y-axis (time) to get the amount of network usage total during that range. I know this would be inaccurate, but I need it to be the right inaccurate using a solid equation.

I thought this was the area under the line, but experiments with much simpler graphs makes this seem just far too high. I figured out I could take the distance from y2 – y1 and multiply it by x2 – x1 and then divide by two to get the area of the graph below the line like a triangle, but again, the numbers seemed to high. (maybe they are just big numbers and I don’t get this math stuff at all).

So what I need, if anyone would be really awesome enough to provide it before this question is closed down for being too pure-math, is either the name of the concept I should be researching or the equation itself. Or the bad news that I do need advanced math to get an accurate result.

I am not bad at math, just as a last note, I just am not familiar with math beyond 10th grade and so I need some place to start. All the math sites seem to keep it too simple or way over my paygrade.

  • 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-05-12T11:20:11+00:00Added an answer on May 12, 2026 at 11:20 am

    If I understood correctly what you’re asking (and that is somewhat doubtful), you should find what you seek in these links:
    Linear interpolation
    (calculating the value of the point in between)
    Trapezoidal rule
    (calculating the area below the “curve”)


    *****Edit, so we can get this over 🙂 without much ado:*****

    So I have graph made in flot that shows the network usage (in bytes/sec) for the user. The data is 4 minutes apart when there is activity, and otherwise set at the start of the usage range (let’s say day 1) and the end of the range (day 7). The data is coming from a CGI script I have no control over, so I’m fairly limited in what I can provide the user.

    What is a “flot” ?

    Okey, so you have speed on y axis [in bytes/sec]; and time on x axis in [sec], right?
    That means, that if you’re flotting (I’m bored, yes 🙂 speed over time, in linear segments, interpolating at some particular point in time you’ll get speed at that particular point in time.
    If you wish to calculate how much bandwidth you’ve spend, you need to determine the area beneath that curve. The area from point “a” to point “b” will determine the spended bandwidth in [bytes] in that time period.

    It took me weeks to finally get a helpful math person to explain this to me. Everyone else has insisted on trying to teach me Riemann sum techniques and all sorts of other heavy stuff that not only is confusing to me, doesn’t seem necessary for the problem.

    In the immortal words of Snoopy: “Good grief !”

    But I also want the user to be able to highlight the graph from two arbitrary points on the y-axis (time) to get the amount of network usage total during that range. I know this would be inaccurate, but I need it to be the right inaccurate using a solid equation.

    It would not be inaccurate.
    It would be actually perfectly accurate (well, apart from roundoff error in bytes :), since you’re using linear interpolation on linear segments.

    I thought this was the area under the line, but experiments with much simpler graphs makes this seem just far too high. I figured out I could take the distance from y2 – y1 and multiply it by x2 – x1 and then divide by two to get the area of the graph below the line like a triangle, but again, the numbers seemed to high. (maybe they are just big numbers and I don’t get this math stuff at all).

    “like a triangle” –> should be “like a trapezoid”

    If you do deltax*(y2-y1)/2 you will get the area, yes (this works only for linear segments). This is the basis principle of trapezoidal rule.


    If you’re uncertain about what you’re calculating use dimensional analysis: speed is in bytes/sec, time is in sec, bandwidth is in bytes. Multiplying speed*time=bandwidth, and so on.

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

Sidebar

Related Questions

Okay this is probably a rookie question, but I have never done GUI programming
Okay this is a fairly broad question. This is my first App and I'm
Okay this is not a question of how to get all uniques or How
Okay, this may be a dumb question, but I've not been able to find
Okay, so this probably sounds terribly nefarious, but I need such capabilities for my
Okay. I know this looks like the typical Why didn't he just Google it
Okay, I'll try to make this as straight forward as possible. I'm using VB.Net
Okay, my dilemma is this. I have an admin page that I use to
Okay this is a hard question. I'm creating a cube and a pyramid in
This is not a coding question, but am hoping that someone has come across

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.