Ejemplo n.º 1
0
def InputLightPlane7():
    a = Fun.Light()  # a is Incidentlight
    b = Fun.Plane()  # b is the Plane

    a.inc([1, 2, -3], [2, 1, 4])
    b.inc([0, 0, 0], [2, 4, 3])
    n1 = 1
    n2 = 1
    return (a, b, n1, n2)
Ejemplo n.º 2
0
def InputLightPlane3():
    a = Fun.Light()  # a is Incidentlight
    b = Fun.Plane()  # b is the Plane

    a.inc([1, 0, 0], [2, 1, 2])
    b.inc([0, 0, 0], [-1, 4, -0.9])
    n1 = 1
    n2 = 1
    return (a, b, n1, n2)
Ejemplo n.º 3
0
def InputLightPlane13():
    a = Fun.Light()  # a is Incidentlight
    b = Fun.Plane()  # b is the Plane

    a.inc([0, 0, 0], [0, 0, 0])
    b.inc([0, 0, 0], [0, 1, 0])
    n1 = 1
    n2 = 1
    return (a, b, n1, n2)
Ejemplo n.º 4
0
def InputLightPlane9():
    a = Fun.Light()  # a is Incidentlight
    b = Fun.Plane()  # b is the Plane

    a.inc([-1, 1, 0], [1, -1, 0])
    b.inc([0, 0, 0], [0, 1, 0])
    n1 = math.sqrt(2)
    n2 = 1
    return (a, b, n1, n2)
Ejemplo n.º 5
0
def RandomLightInput():

    a = Fun.Light()  # a is Incidentlight
    b = Fun.Plane()  # b is the Plane

    a.inc(np.random.randint(5, size=3), np.random.randint(5, size=3))
    b.inc(np.random.randint(5, size=3), np.random.randint(5, size=3))
    n1 = random.randint(1, 3)
    n2 = random.randint(1, 3)
    return (a, b, n1, n2)
Ejemplo n.º 6
0
def test4():
    a = Fun.Light()  # a is Incident light
    b = Fun.Plane()  # b is the Plane
    #The input of Function
    a.inc([0, 1, 0], [1, 1, 0])
    b.inc([0, 0, 0], [-1, 1, 0])
    n1 = 1
    n2 = 1
    #The output should be

    r2 = Fun.CaPoint(a, b) == False
    assert r2
Ejemplo n.º 7
0
def test3():
    a = Fun.Light()  # a is Incident light
    b = Fun.Plane()  # b is the Plane
    #The input of Function
    a.inc([0, 0, 0], [0, 0, 0])
    b.inc([0, 0, 0], [0, 1, 0])
    n1 = 1
    n2 = 1
    #The output should be

    r1 = (Fun.JudgeCrossPoint(a, b) == False)
    assert r1
Ejemplo n.º 8
0
def test1():
    a = Fun.Light()  # a is Incident light
    b = Fun.Plane()  # b is the Plane
    #The input of Function
    a.inc([-1, 1, 0], [1, -1, 0])
    b.inc([0, 0, 0], [0, 1, 0])
    n1 = math.sqrt(2)
    n2 = 1
    #The output should be

    r1 = (Fun.CaRDir(a, b) == Fun.Normalized(np.array([1, 1, 0]))).all()
    r2 = (Fun.CaPoint(a, b) == np.array([0, 0, 0])).all()
    r3 = (Fun.CaTdir(a, b, n1, n2) == Fun.Normalized(np.array([0, 0,
                                                               0]))).all()
    assert r1 & r2 & r3
Ejemplo n.º 9
0
from mpl_toolkits.mplot3d import axes3d
from matplotlib import cm
import random
import sys
import os

import FunktionLight as Fun
import DisplayWholeProcess as DisWP
import DisplayWholeProcess2 as DisWP2
import test as TS
import AutoTest as TIS

if __name__ == '__main__':
    
    a = Fun.Light()# a is Incidentlight
    b = Fun.Plane()# b is the Plane
    r = Fun.Light()# r is reflectedlight
    t = Fun.Light()# t is refractedlight(transmitted light)
    n1 = 1
    n2 = 1

    # if we will autotest or take the case we handly set
    Autotest = False
    # the results of the autotest ---> WriteN
    WriteN = False
    # WriteN --> and then we write in the AutotestOutput.txt
    f = open("AutotestOutput.txt", 'w+')


# sssd is just for circulation to the gauss random number check 
#    sssd = 1