Пример #1
0
def test_conv7():
    x = Symbol("x")
    y = Symbol("y")
    assert sin(x / 3) == sin(sympy.Symbol("x") / 3)
    assert cos(x / 3) == cos(sympy.Symbol("x") / 3)
    assert tan(x / 3) == tan(sympy.Symbol("x") / 3)
    assert cot(x / 3) == cot(sympy.Symbol("x") / 3)
    assert csc(x / 3) == csc(sympy.Symbol("x") / 3)
    assert sec(x / 3) == sec(sympy.Symbol("x") / 3)
    assert asin(x / 3) == asin(sympy.Symbol("x") / 3)
    assert acos(x / 3) == acos(sympy.Symbol("x") / 3)
    assert atan(x / 3) == atan(sympy.Symbol("x") / 3)
    assert acot(x / 3) == acot(sympy.Symbol("x") / 3)
    assert acsc(x / 3) == acsc(sympy.Symbol("x") / 3)
    assert asec(x / 3) == asec(sympy.Symbol("x") / 3)

    assert sin(x / 3)._sympy_() == sympy.sin(sympy.Symbol("x") / 3)
    assert sin(x / 3)._sympy_() != sympy.cos(sympy.Symbol("x") / 3)
    assert cos(x / 3)._sympy_() == sympy.cos(sympy.Symbol("x") / 3)
    assert tan(x / 3)._sympy_() == sympy.tan(sympy.Symbol("x") / 3)
    assert cot(x / 3)._sympy_() == sympy.cot(sympy.Symbol("x") / 3)
    assert csc(x / 3)._sympy_() == sympy.csc(sympy.Symbol("x") / 3)
    assert sec(x / 3)._sympy_() == sympy.sec(sympy.Symbol("x") / 3)
    assert asin(x / 3)._sympy_() == sympy.asin(sympy.Symbol("x") / 3)
    assert acos(x / 3)._sympy_() == sympy.acos(sympy.Symbol("x") / 3)
    assert atan(x / 3)._sympy_() == sympy.atan(sympy.Symbol("x") / 3)
    assert acot(x / 3)._sympy_() == sympy.acot(sympy.Symbol("x") / 3)
    assert acsc(x / 3)._sympy_() == sympy.acsc(sympy.Symbol("x") / 3)
    assert asec(x / 3)._sympy_() == sympy.asec(sympy.Symbol("x") / 3)
Пример #2
0
def test_conv7():
    x = Symbol("x")
    y = Symbol("y")
    assert sin(x/3) == sin(sympy.Symbol("x") / 3)
    assert cos(x/3) == cos(sympy.Symbol("x") / 3)
    assert tan(x/3) == tan(sympy.Symbol("x") / 3)
    assert cot(x/3) == cot(sympy.Symbol("x") / 3)
    assert csc(x/3) == csc(sympy.Symbol("x") / 3)
    assert sec(x/3) == sec(sympy.Symbol("x") / 3)
    assert asin(x/3) == asin(sympy.Symbol("x") / 3)
    assert acos(x/3) == acos(sympy.Symbol("x") / 3)
    assert atan(x/3) == atan(sympy.Symbol("x") / 3)
    assert acot(x/3) == acot(sympy.Symbol("x") / 3)
    assert acsc(x/3) == acsc(sympy.Symbol("x") / 3)
    assert asec(x/3) == asec(sympy.Symbol("x") / 3)

    assert sin(x/3)._sympy_() == sympy.sin(sympy.Symbol("x") / 3)
    assert sin(x/3)._sympy_() != sympy.cos(sympy.Symbol("x") / 3)
    assert cos(x/3)._sympy_() == sympy.cos(sympy.Symbol("x") / 3)
    assert tan(x/3)._sympy_() == sympy.tan(sympy.Symbol("x") / 3)
    assert cot(x/3)._sympy_() == sympy.cot(sympy.Symbol("x") / 3)
    assert csc(x/3)._sympy_() == sympy.csc(sympy.Symbol("x") / 3)
    assert sec(x/3)._sympy_() == sympy.sec(sympy.Symbol("x") / 3)
    assert asin(x/3)._sympy_() == sympy.asin(sympy.Symbol("x") / 3)
    assert acos(x/3)._sympy_() == sympy.acos(sympy.Symbol("x") / 3)
    assert atan(x/3)._sympy_() == sympy.atan(sympy.Symbol("x") / 3)
    assert acot(x/3)._sympy_() == sympy.acot(sympy.Symbol("x") / 3)
    assert acsc(x/3)._sympy_() == sympy.acsc(sympy.Symbol("x") / 3)
    assert asec(x/3)._sympy_() == sympy.asec(sympy.Symbol("x") / 3)
Пример #3
0
def tan(expr):
    """Tangent"""
    if type(expr) == GC:
        return GC(se.tan(expr.expr), {
            s: d * (1 + se.tan(expr.expr)**2)
            for s, d in expr.gradients.items()
        })
    return se.tan(expr)
Пример #4
0
def reproject_axis_gen2(X, Y, Z, axis, cal):
    #(phase_cal, tilt_cal, curve_cal, gibPhase_cal, gibMag_cal, ogeePhase_cal, ogeeMag_cal) = cal

    B = atan2(Z, X)

    Ydeg = cal.tilt + (-1 if axis else 1) * math.pi / 6.
    tanA = tan(Ydeg)
    normXZ = sqrt(X * X + Z * Z)

    asinArg = tanA * Y / normXZ

    sinYdeg = sin(Ydeg)
    cosYdeg = cos(Ydeg)

    sinPart = sin(B - asin(asinArg) + cal.ogeephase) * cal.ogeemag

    normXYZ = sqrt(X * X + Y * Y + Z * Z)

    modAsinArg = Y / normXYZ / cosYdeg

    asinOut = asin(modAsinArg)

    mod, acc = calc_cal_series(asinOut)

    BcalCurved = sinPart + cal.curve
    asinArg2 = asinArg + mod * BcalCurved / (cosYdeg -
                                             acc * BcalCurved * sinYdeg)

    asinOut2 = asin(asinArg2)
    sinOut2 = sin(B - asinOut2 + cal.gibpha)

    return B - asinOut2 + sinOut2 * cal.gibmag - cal.phase - math.pi / 2.
Пример #5
0
def test_conv7b():
    x = sympy.Symbol("x")
    y = sympy.Symbol("y")
    assert sympify(sympy.sin(x / 3)) == sin(Symbol("x") / 3)
    assert sympify(sympy.sin(x / 3)) != cos(Symbol("x") / 3)
    assert sympify(sympy.cos(x / 3)) == cos(Symbol("x") / 3)
    assert sympify(sympy.tan(x / 3)) == tan(Symbol("x") / 3)
    assert sympify(sympy.cot(x / 3)) == cot(Symbol("x") / 3)
    assert sympify(sympy.csc(x / 3)) == csc(Symbol("x") / 3)
    assert sympify(sympy.sec(x / 3)) == sec(Symbol("x") / 3)
    assert sympify(sympy.asin(x / 3)) == asin(Symbol("x") / 3)
    assert sympify(sympy.acos(x / 3)) == acos(Symbol("x") / 3)
    assert sympify(sympy.atan(x / 3)) == atan(Symbol("x") / 3)
    assert sympify(sympy.acot(x / 3)) == acot(Symbol("x") / 3)
    assert sympify(sympy.acsc(x / 3)) == acsc(Symbol("x") / 3)
    assert sympify(sympy.asec(x / 3)) == asec(Symbol("x") / 3)
Пример #6
0
def test_conv7b():
    x = sympy.Symbol("x")
    y = sympy.Symbol("y")
    assert sympify(sympy.sin(x/3)) == sin(Symbol("x") / 3)
    assert sympify(sympy.sin(x/3)) != cos(Symbol("x") / 3)
    assert sympify(sympy.cos(x/3)) == cos(Symbol("x") / 3)
    assert sympify(sympy.tan(x/3)) == tan(Symbol("x") / 3)
    assert sympify(sympy.cot(x/3)) == cot(Symbol("x") / 3)
    assert sympify(sympy.csc(x/3)) == csc(Symbol("x") / 3)
    assert sympify(sympy.sec(x/3)) == sec(Symbol("x") / 3)
    assert sympify(sympy.asin(x/3)) == asin(Symbol("x") / 3)
    assert sympify(sympy.acos(x/3)) == acos(Symbol("x") / 3)
    assert sympify(sympy.atan(x/3)) == atan(Symbol("x") / 3)
    assert sympify(sympy.acot(x/3)) == acot(Symbol("x") / 3)
    assert sympify(sympy.acsc(x/3)) == acsc(Symbol("x") / 3)
    assert sympify(sympy.asec(x/3)) == asec(Symbol("x") / 3)