Answer to Question #132489 in C++ for Ayesha

Question #132489
3. The tractrix is the curve parametrized by ~x(t) = (t − tanh t,sech t).
(a) Find the arc length function s(t) for the above parametrization.
(b) Find a unit speed parametrization of the tractrix.
1
Expert's answer
2020-09-10T15:09:28-0400
#include <cmath>
#include <iomanip>
#include <iostream>
 
using namespace std;
 

// calculation of ln x
double Lnx(double n)
{
 
    double num, mult, cal, sum = 0;
    num = (n - 1) / (n + 1);
 
    
    //ending the loop
    // improving the precision
    for (int i = 1; i <= 1000; i++) {
        mult = (2 * i) - 1;
        cal = pow(num, mul);
        cal = cal / mul;
        sum = sum + cal;
    }
    sum = 2 * sum;
    return sum;
}
 
// Driver Code
int main()
{
 
    double lnx, param, t = 6;
    
    param = cosh (t);
    lnx = Lnx(param);
    
 
    // setprecision(3) is used to display
    // the output up to 3 decimal places
    
 
    cout << fixed << setprecision(3)
         << "ln (cosh) " << t << " = "
         << lnx << endl;
    
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS