6 kyu

The area between the vertex of the parabola and x-axis

160 of 276tolgaersoy

Description:

The area between the vertex of the parabola and x-axis

1-) Warning

If you don't know about the following topics, you will have problems in this kata.

  • Quadratic equations
  • Parabola
  • Integral

2-) Explanation

  • I will give you 3 values as input in the kata. These are a , b , c. The value of a will never be given as 0. These values are the coefficients of the following equation.

    f(x)=ax2+bx+cf(x) = ax^2 + bx + c
  • The graph of this equation is a parabola.

  • This kata asks you for the area between the vertex of the parabola and x-axis.

  • Don't forget area isn't negative.

3-) Details

  • If the equation hasn't real roots, you should return 0. Because there isn't any area.

  • If the equation has 2 equal real roots, you should return 0. Because 0 is the real area.

  • If the equation has 2 unequal real root, you should return the real area.

    For example

    The real area: 35.265720  --->  return 35.265720
    
  • Given values is definitely between -4000 with 4000. Because the result should be under the DOUBLE_MAX value.

  • I set up the tolerance to 10-6 for the decimal errors.

Letter for you

If you like this kata, don't forget to vote please. Take easy...

-founded by theprotagonist

Mathematics

Stats:

CreatedFeb 15, 2023
PublishedFeb 15, 2023
Warriors Trained540
Total Skips16
Total Code Submissions659
Total Times Completed276
C Completions160
Python Completions109
TypeScript Completions15
Java Completions19
Total Stars14
% of votes with a positive feedback rating96% of 85
Total "Very Satisfied" Votes80
Total "Somewhat Satisfied" Votes4
Total "Not Satisfied" Votes1
Total Rank Assessments17
Average Assessed Rank
7 kyu
Highest Assessed Rank
6 kyu
Lowest Assessed Rank
8 kyu
Ad
Contributors
  • tolgaersoy Avatar
  • mauro-1 Avatar
  • dfhwze Avatar
  • HartlIKS Avatar
Ad