Friday, January 29, 2021

Linear_dist Python

import math

p1 = ()
p2 = ()

print("input Vp1 Hp1 VHp1")
Vp1 = int(input())
Hp1 = int(input())
VHp1 = int(input())

p1 = (Vp1, Hp1, VHp1)

print("input Vp2 Hp2 VHp2")
Vp2 = int(input())
Hp2 = int(input())
VHp2 =int(input())

p2 = (Vp2, Hp2, VHp2)

v_1= tuple(map(lambda p1, p2: p1 - p2, p1,p2))

v_1_vd = v_1[0]
v_1_hd = v_1[1]
v_1_vhd = v_1[2]

LD = math.sqrt((v_1_hd**2) + (v_1_vd**2) + (v_1_vhd**2))
print("LD =", LD)

No comments:

Post a Comment

Gammon => Ham Calculator V1.0

def ham_cooking_time (grams): """ Calculates the cooking time for a ham based on its weight. Args: g...