/home/caleb/ASDV-Java/lab6_CalebFontenot/src/main/java/com/calebfontenot/lab6_calebfontenot/Triangle.java
/*
 * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
 * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
 */
package com.calebfontenot.lab6_calebfontenot;

import java.util.Scanner;

/**
 *
 * @author caleb
 */
public class Triangle {
    public static void main(String[] args) {
        // Setup variables
        double x1,
               y1,
               xIntercept;
        
       // Create scanner
       Scanner input = new Scanner(System.in);
       
       // Prompt for input
       System.out.print("Enter a point's x and y coords: ");
       x1 = input.nextDouble();
       y1 = input.nextDouble();
       
       // Calculate!
       
       // 2. Calculate x by -.5 and add 100 to that
       xIntercept = ((-0.5 * x1) + 100);
        System.out.println("x intercept is " + xIntercept);
       // Check if y is inside of the triangle
        
       if (y1 <= xIntercept)
       {
           System.out.println(x1 +", "+ y1 + " is inside of the triangle!");
       }
       else
       {
           System.out.println(x1 +", "+ y1 + " is outside of the triangle!");
       }
    }
}