- 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 normal at a given point on the curve in C++
Suppose we have a curve like y = x(A - x), we have to find the normal 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 normal using this equation −
$$Y-y=-\lgroup\frac{\text{d}x}{\text{d}y}\rgroup*\lgroup X-x \rgroup$$
Example
#include<iostream> using namespace std; void getNormal(int A, int x, int y) { int differentiation = A - x * 2; if (y == (2 * x - x * x)) { if (differentiation < 0) cout << 0 - differentiation << "y = " << "x" << (0 - x) + (y * differentiation); else if (differentiation > 0) cout << differentiation << "y = " << "-x+" << x + differentiation * y; else cout << "x = " << x; } else cout << "Not possible"; } int main() { int A = 5, x = 2, y = 0; cout << "Equation of normal is: "; getNormal(A, x, y); }
Output
Equation of normal is: 1y = -x+2
- Related Articles
- Find Tangent at a given point on the curve in C++
- C++ Program To Find the Trace and Normal of a given Matrix
- At normal pressure (1 atmospheric pressure) the boiling point of water is98°C100°C110°C90°C
- What is the:(a) far point of a normal human eye?(b) near point of a normal human eye?
- Find the point / ( mathrm{s} ) on the ( x )-axis at the distance 13 from the point ( (11,12) ).
- How to create a standard normal distribution curve with 3-sigma limits in R?
- Java Program To Find the Trace and Normal of a given Matrix
- Swift Program to Find the Trace and Normal of a given Matrix
- A chord of a circle is equal to the radius of the circle. Find the angle subtended by the chord at a point on the minor arc and also at a point on the major arc.
- Find a Fixed Point (Value equal to index) in a given array in C++
- C++ program to find the best fit rectangle that covers a given point
- Find middle point segment from given segment lengths in C++
- Find nth term of the Dragon Curve Sequence in C++
- Given here are some figures.Classify each of them on the basis of the following.(a) Simple curve(b) Simple closed curve(c) Polygon(d) Convex polygon(e) Concave polygon."\n
- Find the arrangement of queue at given time in C++

Advertisements