Uploaded image for project: 'Chukwa'
  1. Chukwa
  2. CHUKWA-69

Calculate trapezoid area for a given series of data

    Details

    • Type: Task
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: User Interface
    • Labels:
      None

      Description

      Calculate trapezoid area for a given series of data.

      suppose we have:

      x0, x1, x2, x3
      y0, y1, y2, y3

      the area would be

      (x1-x0) * (y1+y0)/2 + (x2-x1) * (y2+y1)/2 + (x3-x2) * (y3+y2)/2

      1. CHUKWA-69-1.patch
        5 kB
        Eric Yang
      2. chukwa-69.patch
        5 kB
        Cheng

        Activity

        Hide
        eyang Eric Yang added a comment -

        I just committed this, thanks Cheng.

        Show
        eyang Eric Yang added a comment - I just committed this, thanks Cheng.
        Hide
        zhangyongjiang Cheng added a comment -

        +1 thx for fixing it.

        Show
        zhangyongjiang Cheng added a comment - +1 thx for fixing it.
        Hide
        eyang Eric Yang added a comment -

        Updated test case to calculate the right values.

        Show
        eyang Eric Yang added a comment - Updated test case to calculate the right values.
        Hide
        eyang Eric Yang added a comment -

        This patch is useful for calculating area of a trapezoid. This will be used to calculate cluster usage over a period of time. +1 on the patch.

        Show
        eyang Eric Yang added a comment - This patch is useful for calculating area of a trapezoid. This will be used to calculate cluster usage over a period of time. +1 on the patch.
        Hide
        zhangyongjiang Cheng added a comment -

        Area calculator patch

        Show
        zhangyongjiang Cheng added a comment - Area calculator patch
        Hide
        zhangyongjiang Cheng added a comment -

        Created new class AreaCalculator and unit test class AreaCalculatorTest.

        Show
        zhangyongjiang Cheng added a comment - Created new class AreaCalculator and unit test class AreaCalculatorTest.

          People

          • Assignee:
            zhangyongjiang Cheng
            Reporter:
            zhangyongjiang Cheng
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development