# Arup Guha
# 7/16/2013
# Solution to SI@UCF Homework: Math Class Practice: Problem C

import math
import random

def main():

    random.seed()

    # Pick points
    xA = random.randint(-100,100)
    yA = random.randint(-100,100)
    xB = random.randint(-100,100)
    yB = random.randint(-100,100)
    xC = random.randint(-100,100)
    yC = random.randint(-100,100)

    # Print out points
    print("Point A: (", xA, ", ", yA, ")", sep="")
    print("Point B: (", xB, ", ", yB, ")", sep="")
    print("Point C: (", xC, ", ", yC, ")", sep="")

    # Find all three distances.
    distAB = math.sqrt(math.pow(xA-xB,2) + math.pow(yA-yB,2))
    distAC = math.sqrt(math.pow(xA-xC,2) + math.pow(yA-yC,2))
    distBC = math.sqrt(math.pow(xB-xC,2) + math.pow(yB-yC,2))

    # Get minimum.
    minDist = distAB
    if distAC < minDist:
        minDist = distAC
    if distBC < minDist:
        minDist = distBC

    print("The smallest distance between any two points is ",minDist,".", sep="")

main()    
    
