コード例 #1
0
def findTime(t, s, u, v, theta):
	if (t is ""):
		## find value of t

		if (s is not "") and (v is not "") and (u is not ""):
			## use svut2
			tVal = svut2(s, v, u, t, theta)

		elif (v is not "") and (u is not "") and (s is ""):
			## use vuat
			tVal = vuat(v, u, g, t, theta)

		elif (s is not "") and (u is not "") and (v is ""):
			## use sutat2
			tVal = sutat2(s, u, t, g, theta)

		else:
			## missing value, can't continue
			raise ValueError('Cannot calculate value for "t".')

	else:
		tVal = float(t)

	
	print ("Time (t -> s) is %.10f" % tVal)
	return tVal
コード例 #2
0
def findInitialVelocity(s, v, t, theta):
	if (u is ""):
		## find value of u

		if (s is not "") and (v is not "") and (t is not ""):
			## use svut2
			uVal = svut2(s, v, u, t, theta)

		elif (v is not "") and (s is not "") and (t is ""):
			## use vuas
			uVal = vuas(v, u, g, s, theta)

		elif (v is not "") and (t is not "") and (s is ""):
			## use vuat
			uVal = vuat(v, u, g, t, theta)

		elif (s is not "") and (t is not "") and (v is ""):
			## use sutat2
			uVal = sutat2(s, u, t, g, theta)

		else:
			## missing value, can't continue
			raise ValueError('Cannot calculate value for "u".')

		uVal = float(uVal)

	else:
		uVal = float(u)

	print ("Initial velocity (u -> m/s) is %.10f" % uVal)
	return uVal
コード例 #3
0
def findTime(t, s, u, v, theta):
    if (t is ""):
        ## find value of t

        if (s is not "") and (v is not "") and (u is not ""):
            ## use svut2
            tVal = svut2(s, v, u, t, theta)

        elif (v is not "") and (u is not "") and (s is ""):
            ## use vuat
            tVal = vuat(v, u, g, t, theta)

        elif (s is not "") and (u is not "") and (v is ""):
            ## use sutat2
            tVal = sutat2(s, u, t, g, theta)

        else:
            ## missing value, can't continue
            raise ValueError('Cannot calculate value for "t".')

    else:
        tVal = float(t)

    print("Time (t -> s) is %.10f" % tVal)
    return tVal
コード例 #4
0
def findInitialVelocity(s, v, t, theta):
    if (u is ""):
        ## find value of u

        if (s is not "") and (v is not "") and (t is not ""):
            ## use svut2
            uVal = svut2(s, v, u, t, theta)

        elif (v is not "") and (s is not "") and (t is ""):
            ## use vuas
            uVal = vuas(v, u, g, s, theta)

        elif (v is not "") and (t is not "") and (s is ""):
            ## use vuat
            uVal = vuat(v, u, g, t, theta)

        elif (s is not "") and (t is not "") and (v is ""):
            ## use sutat2
            uVal = sutat2(s, u, t, g, theta)

        else:
            ## missing value, can't continue
            raise ValueError('Cannot calculate value for "u".')

        uVal = float(uVal)

    else:
        uVal = float(u)

    print("Initial velocity (u -> m/s) is %.10f" % uVal)
    return uVal
コード例 #5
0
def findHeight(s, u, v, t, theta):
	## find value of s

	if (v is not "") and (u is not "") and (t is not ""):
		## use svut2
		sVal = svut2(s, v, u, t, theta)

	elif (u is not "") and (v is not "") and (t is ""):
		## use vuas
		sVal = vuas(v, u, g, s, theta)

	elif (u is not "") and (t is not "") and (v is ""):
		## use sutat2
		sVal = sutat2(s, u, t, g, theta)

		sVal = float(sVal)

	print ("Height (s -> m) is %.10f" % sVal)
	return sVal
コード例 #6
0
def findHeight(s, u, v, t, theta):
    ## find value of s

    if (v is not "") and (u is not "") and (t is not ""):
        ## use svut2
        sVal = svut2(s, v, u, t, theta)

    elif (u is not "") and (v is not "") and (t is ""):
        ## use vuas
        sVal = vuas(v, u, g, s, theta)

    elif (u is not "") and (t is not "") and (v is ""):
        ## use sutat2
        sVal = sutat2(s, u, t, g, theta)

        sVal = float(sVal)

    print("Height (s -> m) is %.10f" % sVal)
    return sVal