কার্ভ y = x(A - x) এবং একটি বিন্দু (x,y) দেওয়া আছে। বিন্দুটি কার্ভের ওপর কিনা চেক করে নর্মালের সমীকরণ বের করুন। ডিফারেনশিয়েশন: dy/dx = A - 2x। নর্মালের ঢাল = -dx/dy। সমীকরণ: Y - y = (-1/m)(X - x)।
উদাহরণ
#include <iostream>
using namespace std;
void getNormal(int A, int x, int y) {
int diff = A - 2*x;
if (y == (2*x - x*x)) {
if (diff < 0) cout << 0-diff << "y = " << "x" << (0-x) + y*diff;
else if (diff > 0) cout << diff << "y = " << "-x+" << x + diff*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);
return 0;
}
আউটপুট
Equation of normal is: 1y = -x+2