Advertisement
enkuso

gurvaljin

Feb 9th, 2015
238
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.62 KB | None | 0 0
  1. public class lab {
  2.     public static void main(String[] args){
  3.         Gurvaljin gurvaljin = new Gurvaljin(new Point(8,15), new Point(1,2), new Point(14,2));
  4.         System.out.println("Talbai: " );
  5.         System.out.println(String.valueOf(gurvaljin.getTalbai()));
  6.         System.out.println("Undur: " );
  7.         System.out.println(String.valueOf(gurvaljin.getUndur()));
  8.     }
  9. }
  10.  
  11. public class Gurvaljin
  12. {
  13.     private Point pointA;
  14.     private Point pointB;
  15.     private Point pointC;
  16.    
  17.     public Gurvaljin(Point A, Point B, Point C)
  18.     {
  19.         this.pointA = A;
  20.         this.pointB = B;
  21.         this.pointC = C;
  22.     }
  23.    
  24.     public float getTalbai()
  25.     {
  26.         float talbai = 0;
  27.        
  28.        
  29.        
  30.         return talbai;
  31.     }
  32.    
  33.     public float getUndur()
  34.     {
  35.         float undur = 0;
  36.        
  37.         // http://www.teacherschoice.com.au/maths_library/trigonometry/triangle_given_3_points.htm
  38.         // 3 цэгүүд мэдэгдэж байгаа бол суурь болон өнцөг олох
  39.         // http://www.regentsprep.org/regents/math/algtrig/att13/areatriglesson.htm
  40.         // суурь, өнцөг мэдэгдэж байгаа бол өндөр болон талбайг олох
  41.         //float a =
  42.        
  43.         return undur;
  44.     }
  45.    
  46.     public Point getPointA() {
  47.         return this.pointA;
  48.     }
  49.    
  50.     public Point getPointB() {
  51.         return this.pointB;
  52.     }
  53.    
  54.     public Point getPointB() {
  55.         return this.pointB;
  56.     }
  57. }
  58.  
  59. public class Point
  60. {
  61.     private float x;
  62.     private float y;
  63.    
  64.     public Point(float x, float y)
  65.     {
  66.         this.x = x;
  67.         this.y = y;
  68.     }
  69.    
  70.     public int getX() {
  71.         return this.x;
  72.     }
  73.    
  74.     public int getY() {
  75.         return this.y;
  76.     }
  77.    
  78.     public void setX(int x) {
  79.         this.x = x;
  80.     }
  81.    
  82.     public void setY(int y) {
  83.         this.y = y;
  84.     }
  85. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement