two
DownloadTélécharger
Actions
Vote :
ScreenshotAperçu

Informations
Catégorie :Category: nCreator TI-Nspire
Auteur Author: kboiiii
Type : Classeur 3.0.1
Page(s) : 1
Taille Size: 4.17 Ko KB
Mis en ligne Uploaded: 18/09/2025 - 20:46:58
Uploadeur Uploader: kboiiii (Profil)
Téléchargements Downloads: 1
Visibilité Visibility: Archive publique
Shortlink : https://tipla.net/a4848244
Type : Classeur 3.0.1
Page(s) : 1
Taille Size: 4.17 Ko KB
Mis en ligne Uploaded: 18/09/2025 - 20:46:58
Uploadeur Uploader: kboiiii (Profil)
Téléchargements Downloads: 1
Visibilité Visibility: Archive publique
Shortlink : https://tipla.net/a4848244
Description
Fichier Nspire généré sur TI-Planet.org.
Compatible OS 3.0 et ultérieurs.
<<
import math while True: print("MAIN MENU") print("1. Magnitude/Unit Vector") print("2. Dot Product") print("3. Cross Product") print("4. Cross Product Magnitude") print("5. Angle Between Vectors") print("6. Quadratic Formula") print("7. Geometry") print("8. Exit") choice = input("Select: ") if choice == '1': print("Enter Vector A") while True: try: x = float(input("Enter x: ")) y = float(input("Enter y: ")) z = float(input("Enter z: ")) a = [x, y, z] break except ValueError: print("Error: Numbers only.") mag = math.sqrt(a[0]**2 + a[1]**2 + a[2]**2) print("Magnitude = " + str(mag)) if mag != 0: uv = [a[0]/mag, a[1]/mag, a[2]/mag] print("Unit Vector = <" + str(uv[0]) + ", " + str(uv[1]) + ", " + str(uv[2]) + ">") elif choice == '2': print("Enter Vector A") while True: try: ax = float(input("Enter x: ")) ay = float(input("Enter y: ")) az = float(input("Enter z: ")) a = [ax, ay, az] break except ValueError: print("Error: Numbers only.") print("Enter Vector B") while True: try: bx = float(input("Enter x: ")) by = float(input("Enter y: ")) bz = float(input("Enter z: ")) b = [bx, by, bz] break except ValueError: print("Error: Numbers only.") dot_prod = (a[0]*b[0]) + (a[1]*b[1]) + (a[2]*b[2]) print("Dot Product = " + str(dot_prod)) elif choice == '3': print("Enter Vector A") while True: try: ax = float(input("Enter x: ")) ay = float(input("Enter y: ")) az = float(input("Enter z: ")) a = [ax, ay, az] break except ValueError: print("Error: Numbers only.") print("Enter Vector B") while True: try: bx = float(input("Enter x: ")) by = float(input("Enter y: ")) bz = float(input("Enter z: ")) b = [bx, by, bz] break except ValueError: print("Error: Numbers only.") x = (a[1]*b[2]) - (a[2]*b[1]) y = (a[2]*b[0]) - (a[0]*b[2]) z = (a[0]*b[1]) - (a[1]*b[0]) print("Cross Product = <" + str(x) + ", " + str(y) + ", " + str(z) + ">") elif choice == '4': print("Enter Vector A") while True: try: ax = float(input("Enter x: ")) ay = float(input("Enter y: ")) az = float(input("Enter z: ")) a = [ax, ay, az] break except ValueError: print("Error: Numbers only.") print("Enter Vector B") while True: try: bx = float(input("Enter x: ")) by = float(input("Enter y: ")) bz = float(input("Enter z: ")) b = [bx, by, bz] break except ValueError: print("Error: Numbers only.") x = (a[1]*b[2]) - (a[2]*b[1]) y = (a[2]*b[0]) - (a[0]*b[2]) z = (a[0]*b[1]) - (a[1]*b[0]) mag = math.sqrt(x**2 + y**2 + z**2) print("Magnitude = " + str(mag)) elif choice == '5': print("Enter Vector A") while True: try: ax = float(input("Enter x: ")) ay = float(input("Enter y: ")) az = float(input("Enter z: ")) a = [ax, ay, az] break except ValueError: print("Error: Numbers only.") print("Enter Vector B") while True: try: bx = float(input("Enter x: ")) by = float(input("Enter y: ")) bz = float(input("Enter z: ")) b = [bx, by, bz] break except ValueError: print("Error: Numbers only.") dot = (a[0]*b[0]) + (a[1]*b[1]) + (a[2]*b[2]) mag_a = math.sqrt(a[0]**2 + a[1]**2 + a[2]**2) mag_b = math.sqrt(b[0]**2 + b[1]**2 + b[2]**2) if mag_a == 0 or mag_b == 0: print("Error: Zero vector") else: cos_t = dot / (mag_a * mag_b) if cos_t > 1.0: cos_t = 1.0 if cos_t < -1.0: cos_t = -1.0 rad = math.acos(cos_t) deg = math.degrees(rad) print("Radians = " + str(rad)) print("Degrees = " + str(deg)) elif choice == '6': print("ax^2+bx+c=0") try: a_q = float(input("a: ")) b_q = float(input("b: ")) c_q = float(input("c: "))
[...]
>>
Compatible OS 3.0 et ultérieurs.
<<
import math while True: print("MAIN MENU") print("1. Magnitude/Unit Vector") print("2. Dot Product") print("3. Cross Product") print("4. Cross Product Magnitude") print("5. Angle Between Vectors") print("6. Quadratic Formula") print("7. Geometry") print("8. Exit") choice = input("Select: ") if choice == '1': print("Enter Vector A") while True: try: x = float(input("Enter x: ")) y = float(input("Enter y: ")) z = float(input("Enter z: ")) a = [x, y, z] break except ValueError: print("Error: Numbers only.") mag = math.sqrt(a[0]**2 + a[1]**2 + a[2]**2) print("Magnitude = " + str(mag)) if mag != 0: uv = [a[0]/mag, a[1]/mag, a[2]/mag] print("Unit Vector = <" + str(uv[0]) + ", " + str(uv[1]) + ", " + str(uv[2]) + ">") elif choice == '2': print("Enter Vector A") while True: try: ax = float(input("Enter x: ")) ay = float(input("Enter y: ")) az = float(input("Enter z: ")) a = [ax, ay, az] break except ValueError: print("Error: Numbers only.") print("Enter Vector B") while True: try: bx = float(input("Enter x: ")) by = float(input("Enter y: ")) bz = float(input("Enter z: ")) b = [bx, by, bz] break except ValueError: print("Error: Numbers only.") dot_prod = (a[0]*b[0]) + (a[1]*b[1]) + (a[2]*b[2]) print("Dot Product = " + str(dot_prod)) elif choice == '3': print("Enter Vector A") while True: try: ax = float(input("Enter x: ")) ay = float(input("Enter y: ")) az = float(input("Enter z: ")) a = [ax, ay, az] break except ValueError: print("Error: Numbers only.") print("Enter Vector B") while True: try: bx = float(input("Enter x: ")) by = float(input("Enter y: ")) bz = float(input("Enter z: ")) b = [bx, by, bz] break except ValueError: print("Error: Numbers only.") x = (a[1]*b[2]) - (a[2]*b[1]) y = (a[2]*b[0]) - (a[0]*b[2]) z = (a[0]*b[1]) - (a[1]*b[0]) print("Cross Product = <" + str(x) + ", " + str(y) + ", " + str(z) + ">") elif choice == '4': print("Enter Vector A") while True: try: ax = float(input("Enter x: ")) ay = float(input("Enter y: ")) az = float(input("Enter z: ")) a = [ax, ay, az] break except ValueError: print("Error: Numbers only.") print("Enter Vector B") while True: try: bx = float(input("Enter x: ")) by = float(input("Enter y: ")) bz = float(input("Enter z: ")) b = [bx, by, bz] break except ValueError: print("Error: Numbers only.") x = (a[1]*b[2]) - (a[2]*b[1]) y = (a[2]*b[0]) - (a[0]*b[2]) z = (a[0]*b[1]) - (a[1]*b[0]) mag = math.sqrt(x**2 + y**2 + z**2) print("Magnitude = " + str(mag)) elif choice == '5': print("Enter Vector A") while True: try: ax = float(input("Enter x: ")) ay = float(input("Enter y: ")) az = float(input("Enter z: ")) a = [ax, ay, az] break except ValueError: print("Error: Numbers only.") print("Enter Vector B") while True: try: bx = float(input("Enter x: ")) by = float(input("Enter y: ")) bz = float(input("Enter z: ")) b = [bx, by, bz] break except ValueError: print("Error: Numbers only.") dot = (a[0]*b[0]) + (a[1]*b[1]) + (a[2]*b[2]) mag_a = math.sqrt(a[0]**2 + a[1]**2 + a[2]**2) mag_b = math.sqrt(b[0]**2 + b[1]**2 + b[2]**2) if mag_a == 0 or mag_b == 0: print("Error: Zero vector") else: cos_t = dot / (mag_a * mag_b) if cos_t > 1.0: cos_t = 1.0 if cos_t < -1.0: cos_t = -1.0 rad = math.acos(cos_t) deg = math.degrees(rad) print("Radians = " + str(rad)) print("Degrees = " + str(deg)) elif choice == '6': print("ax^2+bx+c=0") try: a_q = float(input("a: ")) b_q = float(input("b: ")) c_q = float(input("c: "))
[...]
>>