- Trending Categories
- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP

- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who

# Python Program for Finding the vertex, focus and directrix of a parabola

In this article, we will learn about the solution to the problem statement given below −

## Problem statement

The standard form of a parabola equation is y=ax^2+bx+c. Input the values of a, b and c, our task is to find the coordinates of the vertex, focus and the equation of the directrix.

**The vertex** of a parabola is the coordinate from which it takes the sharpest turn whereas y=a is the straight-line used to generate the curve.

**A directrix** a fixed-line used in describing a curve or surface.

Now let’s see the implementation −

## Example

def findparabola(a, b, c): print ("Vertex: (" , (-b / (2 * a)) , ", ",(((4 * a * c) - (b * b)) / (4 * a)) , ")" ) print ("Focus: (" , (-b / (2 * a)) , ", ", (((4 * a * c) -(b * b) + 1) / (4 * a)) , ")" ) print ("Directrix: y=", (int)(c - ((b * b) + 1) * 4 * a )) # main() a = 7 b = 5 c = 3 findparabola(a, b, c)

## Output

Vertex: ( -0.35714285714285715 , 2.107142857142857 ) Focus: ( -0.35714285714285715 , 2.142857142857143 ) Directrix: y= -725

All the variables & the function are declared in the global scope as shown in the figure below.

## Conclusion

In this article, we learned about finding the vertex, focus, and directrix of a parabola

- Related Questions & Answers
- Finding the vertex, focus and directrix of a parabola in Python Program
- C/C++ Program for Finding the vertex, focus and directrix of a parabola?
- C/C++ Program for Finding the vertex, focus and directrix of the parabola?
- Finding the vertex, focus and directrix of a parabola in C++
- C++ program to find the vertex, focus and directrix of a parabola
- Java Program to find the vertex, focus and directrix of a parabola
- Pendent Vertex, Isolated Vertex and Adjacency of a graph
- Golang program to calculate the absolute and scale of a vertex.
- Program to calculate vertex-to-vertex reachablity matrix in Python
- C++ Program to Find the Vertex Connectivity of a Graph
- Program to find out the minimum cost path between the lowest value vertex to the highest value vertex (Python)
- Degree of Vertex of a Graph
- Finding the path from one vertex to rest using BFS in C++
- Cut Set and Cut Vertex of Graph
- C++ Program to Implement a Heuristic to Find the Vertex Cover of a Graph

Advertisements