third_party/inchi/INCHI_BASE/src/ichister.c
int are_4at_in_one_plane( double at_coord[][3], double min_sine )
{
    double actual_min_sine, min_actual_min_sine;
    double coord[3][3], prod;
    int i, k, j;
    for (k = 0; k < 4; k++)
    {
        for (i = j = 0; i < 4; i++)
        {
            if (i != k)
            {
                diff3( at_coord[i], at_coord[k], coord[j] );
                j++;
            }
        }

        prod = triple_prod_and_min_abs_sine( coord, &actual_min_sine );
        if (!k || actual_min_sine < min_actual_min_sine)
        {
            min_actual_min_sine = actual_min_sine;
        }
    }

    return min_actual_min_sine <= min_sine;
}
/****************************************************************************
  Find if 4 atoms are in one plane
****************************************************************************/
Find if 4 atoms are in one plane
Find if 4 atoms are in one plane
int are_4at_in_one_plane( double at_coord[][3], double min_sine )
{
    double actual_min_sine, min_actual_min_sine;
    double coord[3][3], prod;
    int i, k, j;
    for (k = 0; k < 4; k++)
    {
        for (i = j = 0; i < 4; i++)
        {
            if (i != k)
            {
                diff3( at_coord[i], at_coord[k], coord[j] );
                j++;
            }
        }
        prod = triple_prod_and_min_abs_sine( coord, &actual_min_sine );
        if (!k || actual_min_sine < min_actual_min_sine)
        {
            min_actual_min_sine = actual_min_sine;
        }
    }
    return min_actual_min_sine <= min_sine;
}
int are_4at_in_one_plane ( double at_coord [ ] [ 3 ] , double min_sine ) { double actual_min_sine , min_actual_min_sine ; double coord [ 3 ] [ 3 ] , prod ; int i , k , j ; for ( k = 0 ; k < 4 ; k ++ ) { for ( i = j = 0 ; i < 4 ; i ++ ) { if ( i != k ) { diff3 ( at_coord [ i ] , at_coord [ k ] , coord [ j ] ) ; j ++ ; } } prod = triple_prod_and_min_abs_sine ( coord , & actual_min_sine ) ; if ( ! k || actual_min_sine < min_actual_min_sine ) { min_actual_min_sine = actual_min_sine ; } } return min_actual_min_sine <= min_sine ; }
Find if 4 atoms are in one plane
Find if 4 atoms are in one plane