# Program to input a vector and determine i) the norm and ii)angle with each of the axes
x,y,z =input("Enter the values of x, y and z:").split(",")
x=float(x)
y=float(y)
z=float(z)
from math import *
n=sqrt(x**2+y**2+z**2)
x1=degrees(acos(x/n))
y1=degrees(acos(y/n))
z1=degrees(acos(z/n))
print("Norm of the entered vector=",n)
print("Angle made with x axis in degrees:",x1)
print("Angle made with y axis in degrees:",y1)
print("Angle made with z axis in degrees:",z1)
x,y,z =input("Enter the values of x, y and z:").split(",")
x=float(x)
y=float(y)
z=float(z)
from math import *
n=sqrt(x**2+y**2+z**2)
x1=degrees(acos(x/n))
y1=degrees(acos(y/n))
z1=degrees(acos(z/n))
print("Norm of the entered vector=",n)
print("Angle made with x axis in degrees:",x1)
print("Angle made with y axis in degrees:",y1)
print("Angle made with z axis in degrees:",z1)
Comments
Post a Comment