Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6743459
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T11:57:49+00:00 2026-05-26T11:57:49+00:00

How to check whether the curve is C1 class or C2 class. Example: x

  • 0

How to check whether the curve is C1 class or C2 class.

Example:

x = [1,2,3,4,5,6,7,8,9 ......1500] 

y = [0.56, 1, 12, 41, 01. ....... 11, 0.11, 3, 23, 95] 

This curve is C1 class “function” ?

Thank you very much.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T11:57:49+00:00Added an answer on May 26, 2026 at 11:57 am

    While technically you can’t check if the data corresponds to a C1 or C2 curve – you can do something that still might be useful.

    C1 means continuous 1st derivative. So if you calculate the derivative numerically and then see big jumps in the derivative then you might suspect that the underlying curve is not C1. (You can’t actually guarantee that, but you can guarantee that it is either not C1 or has derivative outside some bounds). Conversely if you don’t get any big jumps then there is a C1 curve with bounded derivative that does fit the data – just not necessarily the same curve that actually generated the data.

    You can do something similar with the numerically calculated second derivative to determine its C2 status. (Note that if its not C1, then it can’t be C2 – so if that test fails you can forget about the second test.)

    Here’s roughly how I’d do it in C++ for the C1 case with evenly spaced x points. (If things are not evenly spaced you’ll need to tweak the calculation of s).

    double y[N] = {0.56, 1, 12, 41, ..., 11, 0.11, 3, 23, 95 };
    
    double max_abs_slope = 0;
    double sum_abs_slope = 0;
    double sum_abs_slope_sq = 0;
    unsigned int imax=0;
    
    for(unsigned int i=0; i<N-1; ++i )
    {
      double s = fabs( y[i+1]-y[i] );
      sum_abs_slope += s;
      sum_abs_slope_sq += s*s;
      if(s>max_abs_slope) { max_abs_slope = s; imax = i; }
    }
    
    // We expect the max to be within three std-dev of the average.
    double stddev = sqrt(  (N*sum_abs_slope_sq - sum_abs_slope*sum_abs_slope)/(N*(N-1)) );
    
    if( ( max_abs_slope - sum_abs_slope/(N-1) ) > 3 * stddev )
    {  
       std::cout<<"There's an unexpectedly large jump in interval "<<imax<<std::endl;
    }
    else
    {
       std::cout<<"It seems smooth"<<std::endl;
    }
    

    However you might use a different threshold than 3*stddev, you might pick an actual limit based on
    your knowledge of the underlying problem, or you might choose to be stricter (using a value >3) or less strict (<3).

    I’ve not tested this code, so it may not run or may be buggy.
    I’ve also not checked that 3*stddev makes sense for any curves.
    This is very much caveat emptor.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I wanted to check whether the variable is defined or not. For example, the
I want to check whether a div with a CSS class="x" has height="auto" If
Can we check whether a pointer passed to a function is allocated with memory
I want to check whether these variables have same values. EXAMPLE: int a =
i should check whether there is some values based on this condition. if there
I want to check whether records exist under conditions. This line works fine: DataContext.Alerts.Count(e
Is it possible to check whether a browser-provided function has been replaced by user
I wanted to check whether g++ supports tail calling so I wrote this simple
I need to check whether the departure-date is after the arrivaldate. For example: arrivaldate
I want to I check whether a string is in ASCII or not. I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.