Skip to content
This repository has been archived by the owner on Oct 23, 2018. It is now read-only.

Commit

Permalink
organize some files by language
Browse files Browse the repository at this point in the history
  • Loading branch information
Nestor Velez committed Oct 14, 2018
1 parent e0b2066 commit ee43704
Show file tree
Hide file tree
Showing 11 changed files with 22 additions and 27 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
5 changes: 0 additions & 5 deletions Hello World

This file was deleted.

File renamed without changes.
42 changes: 21 additions & 21 deletions Dot Product.py → Python/Dot Product with math.py
@@ -1,21 +1,21 @@
import numpy as np
import os
import math

def dot_product(a,b):
return(a[0]*b[0]+a[1]*b[1]+a[2]*b[2])

def angle(a,b):
dot=dot_product(a,b)
mag_a=(a[0]**2+a[1]**2+a[2]**2)**0.5
mag_b=(b[0]**2+b[1]**2+b[2]**2)**0.5
return math.acos(dot/(mag_a*mag_b))
a=np.zeros(3)
b=np.zeros(3)
print("Use Rectangular Coordinats x, y and z")
for i in range(3):
a[i]=int(input("write the"+str(i)+"element of a"))
b[i]=int(input("write the"+str(i)+"element of b"))
print("The vectors are\n",a,"\n",b)
print("Dot Product is", dot_product(a,b))
print("Angle between two vectors is (in radians)", angle(a,b), "and in degrees",(180/math.pi)*angle(a,b))
import numpy as np
import os
import math

def dot_product(a,b):
return(a[0]*b[0]+a[1]*b[1]+a[2]*b[2])

def angle(a,b):
dot=dot_product(a,b)
mag_a=(a[0]**2+a[1]**2+a[2]**2)**0.5
mag_b=(b[0]**2+b[1]**2+b[2]**2)**0.5
return math.acos(dot/(mag_a*mag_b))
a=np.zeros(3)
b=np.zeros(3)
print("Use Rectangular Coordinats x, y and z")
for i in range(3):
a[i]=int(input("write the"+str(i)+"element of a"))
b[i]=int(input("write the"+str(i)+"element of b"))
print("The vectors are\n",a,"\n",b)
print("Dot Product is", dot_product(a,b))
print("Angle between two vectors is (in radians)", angle(a,b), "and in degrees",(180/math.pi)*angle(a,b))
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion crystal/hello_world.cr
@@ -1,3 +1,3 @@
# Hello world in Crystal

puts "Hello World"
puts "Hello World"

0 comments on commit ee43704

Please sign in to comment.