- Trending Categories
- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies

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

# Find Tangent at a given point on the curve in C++

Suppose we have a curve like y = x(A - x), we have to find the tangent at a given point (x,y) on that curve. Here A is an integer number, x and y are also integers.

To solve this, we have the check that the given point is on the curve or not, if so, then find the differentiation of that curve, so it will be −

$$\frac{\text{d}y}{\text{d}x}=A-2x$$

Then put x and y into the dy/dx, then find the tangent using this equation −

$$Y-y=-\lgroup\frac{\text{d}y}{\text{d}x}\rgroup*\lgroup X-x \rgroup$$

## Example

#include<iostream> using namespace std; void getTangent(int A, int x, int y) { int differentiation = A - x * 2; if (y == (2 * x - x * x)) { if (differentiation < 0) cout << "y = " << differentiation << "x" << (x * differentiation) + (y); else if (differentiation > 0) cout << "y = " << differentiation << "x+" << -x * differentiation + y; else cout << "Not possible"; } } int main() { int A = 2, x = 2, y = 0; cout << "Equation of tangent is: "; getTangent(A, x, y); }

## Output

Equation of tangent is: y = -2x-4

- Related Articles
- Find normal at a given point on the curve in C++
- Fill in the blanks :The angle between tangent at a point on a circle and the radius through the point is ………..
- In Fig. 1, QR is a common tangent to the given circles, touching externally at the point. The tangent at T meets QR at P. If $PT= 3.8 cm$, then the length of QR $( in cm)$ is: $( A) 3.8$ $( B) 76$ $( C) 5.7$ $( D) 1.9$"
- C++ Program to find the tangent of given radian value
- In the figure, the tangent at a point ( C ) of a circle and a diameter ( A B ) when extended intersect at ( P ). If ( angle P C A=110^{circ} ), find ( angle C B A. )"
- C++ Program to find the hyperbolic tangent of given radian value
- In the given figure, two circles touch each other at a point $D$.A common tangent touch both circles at $A$ and $B$ respectively. Show that $CA=CB$."
- Prove that the tangent at any point of a circle is perpendicular to the radius through the point of contact.
- Prove that the tangent at any point of a circle is perpendicular to the radius through the point of the contact.
- O is the centre of a circle of radius 8 cm. The tangent at a point A on the circle cuts a line through O at B such that $AB = 15 cm$. Find OB.
- How to find the Arc Tangent of a given value in Golang?
- How to find the Hyperbolic Arc Tangent of a given value in Golang?
- How to find the Hyperbolic Tangent of a given radian value in Golang?
- Prove that the perpendicular at the point of contact to the tangent to a circle passes through the centre.
- ( A ) is a point at a distance ( 13 mathrm{~cm} ) from the centre ( O ) of a circle of radius ( 5 mathrm{~cm} ). ( A P ) and ( A Q ) are the tangents to the circle at ( P ) and ( Q ). If a tangent ( B C ) is drawn at a point ( R ) lying on the minor arc ( P Q ) to intersect ( A P ) at ( B ) and ( A Q ) at ( C ), find the perimeter of the ( triangle A B C ).

Advertisements