Exemplo n.º 1
0
	/* compute time for a given angle G */
	double compute_time(double g, double t)
	{
		double d = sun_declination(julian_date + t);
		double z = compute_mid_day(t);
		double v = 1.0 / 15.0 * darccos((-dsin(g) - dsin(d) * dsin(latitude)) / (dcos(d) * dcos(latitude)));
		return z + (g > 90.0 ? - v :  v);
	}
Exemplo n.º 2
0
void
d_scalar_scalar_1(void)
{
    // d(x,x)?

    if (equal(p1, p2)) {
        push(one);
        return;
    }

    // d(a,x)?

    if (!iscons(p1)) {
        push(zero);
        return;
    }

    if (isadd(p1)) {
        dsum();
        return;
    }

    if (car(p1) == symbol(MULTIPLY)) {
        dproduct();
        return;
    }

    if (car(p1) == symbol(POWER)) {
        dpower();
        return;
    }

    if (car(p1) == symbol(DERIVATIVE)) {
        dd();
        return;
    }

    if (car(p1) == symbol(LOG)) {
        dlog();
        return;
    }

    if (car(p1) == symbol(SIN)) {
        dsin();
        return;
    }

    if (car(p1) == symbol(COS)) {
        dcos();
        return;
    }

    if (car(p1) == symbol(TAN)) {
        dtan();
        return;
    }

    if (car(p1) == symbol(ARCSIN)) {
        darcsin();
        return;
    }

    if (car(p1) == symbol(ARCCOS)) {
        darccos();
        return;
    }

    if (car(p1) == symbol(ARCTAN)) {
        darctan();
        return;
    }

    if (car(p1) == symbol(SINH)) {
        dsinh();
        return;
    }

    if (car(p1) == symbol(COSH)) {
        dcosh();
        return;
    }

    if (car(p1) == symbol(TANH)) {
        dtanh();
        return;
    }

    if (car(p1) == symbol(ARCSINH)) {
        darcsinh();
        return;
    }

    if (car(p1) == symbol(ARCCOSH)) {
        darccosh();
        return;
    }

    if (car(p1) == symbol(ARCTANH)) {
        darctanh();
        return;
    }

    if (car(p1) == symbol(ABS)) {
        dabs();
        return;
    }

    if (car(p1) == symbol(SGN)) {
        dsgn();
        return;
    }

    if (car(p1) == symbol(HERMITE)) {
        dhermite();
        return;
    }

    if (car(p1) == symbol(ERF)) {
        derf();
        return;
    }

    if (car(p1) == symbol(ERFC)) {
        derfc();
        return;
    }

    /*if (car(p1) == symbol(BESSELJ)) {
    	if (iszero(caddr(p1)))
    		dbesselj0();
    	else
    		dbesseljn();
    	return;
    }*/

    /*if (car(p1) == symbol(BESSELY)) {
    	if (iszero(caddr(p1)))
    		dbessely0();
    	else
    		dbesselyn();
    	return;
    }*/

    if (car(p1) == symbol(INTEGRAL) && caddr(p1) == p2) {
        derivative_of_integral();
        return;
    }

    dfunction();
}