Advertisement
Guest User

grafa6

a guest
Apr 24th, 2018
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 18.40 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. using System.Windows.Forms;
  10.  
  11. namespace WindowsFormsApplication1
  12. {
  13.    
  14.     public partial class Form1 : Form
  15.     {
  16.         private delegate void PaintPicture();
  17.         PaintPicture paintPicture;
  18.         private System.Drawing.Graphics g;
  19.         private System.Drawing.Pen pen1 = new System.Drawing.Pen(Color.Black, 1);
  20.         private System.Drawing.Pen pen_red = new System.Drawing.Pen(Color.Red, 1);
  21.         private System.Drawing.Pen pen_gray = new System.Drawing.Pen(Color.Gray, 1);
  22.         private System.Drawing.Pen pen_green = new System.Drawing.Pen(Color.Green, 1);
  23.         private SolidBrush brush1 = new SolidBrush(Color.Red);
  24.          
  25.         public Form1()
  26.         {
  27.             InitializeComponent();
  28.             g = pictureBox1.CreateGraphics();
  29.             P1x.Text = "-150";
  30.             P1y.Text = "100";
  31.             P2x.Text = "30";
  32.             P2y.Text = "70";
  33.             P3x.Text = "150";
  34.             P3y.Text = "170";
  35.             P4x.Text = "185";
  36.             P4y.Text = "80";
  37.             P5x.Text = "70";
  38.             P5y.Text = "-20";
  39.             P6x.Text = "160";
  40.             P6y.Text = "-80";
  41.             P7x.Text = "-60";
  42.             P7y.Text = "-80";
  43.             P8x.Text = "-50";
  44.             P8y.Text = "60";
  45.             P9x.Text = "-30";
  46.             P9y.Text = "-30";
  47.             P10x.Text = "-100";
  48.             P10y.Text = "180";
  49.             paintPicture = ktora_strona;
  50.         }
  51.  
  52.  
  53.  
  54.         private void label2_Click(object sender, EventArgs e)
  55.         {
  56.  
  57.         }
  58.  
  59.         private void krzywaHermitea_Click(object sender, EventArgs e)
  60.         {
  61.             int P1_x, P1_y, P2_x, P2_y;
  62.             int.TryParse(P1x.Text, out P1_x);
  63.             int.TryParse(P1y.Text, out P1_y);
  64.             int.TryParse(P2x.Text, out P2_x);
  65.             int.TryParse(P2y.Text, out P2_y);
  66.            
  67.            
  68.             drawPoint(P2_x, P2_y, Color.Black);
  69.             drawPoint(P1_x, P1_y, Color.Black);
  70.             g.DrawLine(pen_gray, P1_x + pictureBox1.Width / 2, -P1_y + pictureBox1.Height / 2, P2_x  + pictureBox1.Width / 2, -(P2_y) + pictureBox1.Height / 2);
  71.            
  72.             g.DrawLine(pen1, 20, pictureBox1.Height / 2, pictureBox1.Width - 20, pictureBox1.Height / 2);
  73.             g.DrawLine(pen1, pictureBox1.Width / 2, 20, pictureBox1.Width / 2, pictureBox1.Height - 20);
  74.         }
  75.  
  76.         private void wyczysc_Click(object sender, EventArgs e)
  77.         {
  78.             pictureBox1.Refresh();
  79.             g.DrawLine(pen1, 20, pictureBox1.Height / 2, pictureBox1.Width - 20, pictureBox1.Height / 2);
  80.             g.DrawLine(pen1, pictureBox1.Width / 2, 20, pictureBox1.Width / 2, pictureBox1.Height - 20);
  81.         }
  82.         private void drawPoint(int x, int y, Color color)
  83.         {
  84.             System.Drawing.Pen point_pen = new System.Drawing.Pen(color, 1);
  85.             SolidBrush point_brush = new SolidBrush(color );
  86.             g.DrawEllipse(point_pen, x-2 + pictureBox1.Width / 2, -y - 2 + pictureBox1.Height / 2, 4, 4);
  87.             g.FillEllipse(point_brush, x - 2 + pictureBox1.Width / 2, -y - 2 + pictureBox1.Height / 2, 4, 4);
  88.         }
  89.         private void krzywabaziera_Click(object sender, EventArgs e)
  90.         {
  91.  
  92.             paintPicture = ktora_strona;
  93.             paintPicture();
  94.  
  95.         }
  96.         void ktora_strona()
  97.         {
  98.             int P1_x, P1_y, P2_x, P2_y, R1_x, R1_y;
  99.             int.TryParse(P1x.Text, out P1_x);
  100.             int.TryParse(P1y.Text, out P1_y);
  101.             int.TryParse(P2x.Text, out P2_x);
  102.             int.TryParse(P2y.Text, out P2_y);
  103.             int.TryParse(P3x.Text, out R1_x);
  104.             int.TryParse(P3y.Text, out R1_y);
  105.  
  106.             Matrix3x3 matrix = new Matrix3x3(P1_x, P1_y, 1, P2_x, P2_y, 1,
  107.                 R1_x, R1_y, 1);
  108.             float det = matrix.getDet();
  109.             String ktora_strona = "Na linii";
  110.  
  111.             if (det > 0)
  112.             {
  113.                 ktora_strona = "Po lewej";
  114.             }
  115.             else if (det < 0)
  116.             {
  117.                 ktora_strona = "Po prawej";
  118.             }
  119.             strona.Text = ktora_strona;
  120.             g.DrawLine(pen_gray, P1_x + pictureBox1.Width / 2, -P1_y + pictureBox1.Height / 2, P2_x + pictureBox1.Width / 2, -(P2_y) + pictureBox1.Height / 2);
  121.             g.DrawLine(pen1, 20, pictureBox1.Height / 2, pictureBox1.Width - 20, pictureBox1.Height / 2);
  122.             g.DrawLine(pen1, pictureBox1.Width / 2, 20, pictureBox1.Width / 2, pictureBox1.Height - 20);
  123.             drawPoint(P1_x, P1_y, Color.Black);
  124.             drawPoint(P2_x, P2_y, Color.Black);
  125.             drawPoint(R1_x, R1_y, Color.Red);
  126.         }
  127.  
  128.         private void bsklejane_Click(object sender, EventArgs e)
  129.         {
  130.             paintPicture = czy_dwa_punkty;
  131.             paintPicture();
  132.         }
  133.         void czy_dwa_punkty()
  134.         {
  135.             int P1_x, P1_y, P2_x, P2_y, P3_x, P3_y, P4_x, P4_y, P5_x, P5_y, P6_x, P6_y, P7_x, P7_y, P8_x, P8_y;
  136.  
  137.  
  138.             int.TryParse(P1x.Text, out P1_x);
  139.             int.TryParse(P1y.Text, out P1_y);
  140.             int.TryParse(P2x.Text, out P2_x);
  141.             int.TryParse(P2y.Text, out P2_y);
  142.             int.TryParse(P4x.Text, out P4_x);
  143.             int.TryParse(P4y.Text, out P4_y);
  144.             int.TryParse(P5x.Text, out P5_x);
  145.             int.TryParse(P5y.Text, out P5_y);
  146.  
  147.             g.DrawLine(pen_gray, P1_x + pictureBox1.Width / 2, -P1_y + pictureBox1.Height / 2, P2_x + pictureBox1.Width / 2, -(P2_y) + pictureBox1.Height / 2);
  148.             g.DrawLine(pen1, 20, pictureBox1.Height / 2, pictureBox1.Width - 20, pictureBox1.Height / 2);
  149.             g.DrawLine(pen1, pictureBox1.Width / 2, 20, pictureBox1.Width / 2, pictureBox1.Height - 20);
  150.             drawPoint(P1_x, P1_y, Color.Black);
  151.             drawPoint(P2_x, P2_y, Color.Black);
  152.             drawPoint(P4_x, P4_y, Color.Green);
  153.             drawPoint(P5_x, P5_y, Color.Green);
  154.  
  155.             Matrix3x3 matrix1 = new Matrix3x3(P1_x, P1_y, 1, P2_x, P2_y, 1,
  156.                 P4_x, P4_y, 1);
  157.             Matrix3x3 matrix2 = new Matrix3x3(P1_x, P1_y, 1, P2_x, P2_y, 1,
  158.                 P5_x, P5_y, 1);
  159.             String ta_sama_strona = "na linii";
  160.  
  161.             if (Math.Sign(matrix1.getDet()) == Math.Sign(matrix2.getDet()))
  162.             {
  163.                 ta_sama_strona = "Po tej samej stronie";
  164.             }
  165.             else
  166.             {
  167.                 ta_sama_strona = "Po innych stronach";
  168.  
  169.             }
  170.             label17.Text = ta_sama_strona;
  171.         }
  172.      
  173.  
  174.      private void label8_Click(object sender, EventArgs e)
  175.      {
  176.  
  177.      }
  178.  
  179.      private void button1_Click(object sender, EventArgs e)
  180.      {
  181.          int P1_x, P1_y, P2_x, P2_y, P6_x, P6_y;
  182.          int.TryParse(P1x.Text, out P1_x);
  183.          int.TryParse(P1y.Text, out P1_y);
  184.          int.TryParse(P2x.Text, out P2_x);
  185.          int.TryParse(P2y.Text, out P2_y);
  186.          int.TryParse(P6x.Text, out P6_x);
  187.          int.TryParse(P6y.Text, out P6_y);
  188.  
  189.  
  190.          g.DrawLine(pen_gray, P1_x + pictureBox1.Width / 2, -P1_y + pictureBox1.Height / 2, P2_x + pictureBox1.Width / 2, -(P2_y) + pictureBox1.Height / 2);
  191.          g.DrawLine(pen1, 20, pictureBox1.Height / 2, pictureBox1.Width - 20, pictureBox1.Height / 2);
  192.          g.DrawLine(pen1, pictureBox1.Width / 2, 20, pictureBox1.Width / 2, pictureBox1.Height - 20);
  193.          drawPoint(P1_x, P1_y, Color.Black);
  194.          drawPoint(P2_x, P2_y, Color.Black);
  195.          drawPoint(P6_x, P6_y, Color.Blue);
  196.           Matrix3x3 matrix = new Matrix3x3(P1_x, P1_y, 1, P2_x, P2_y, 1, P6_x, P6_y, 1);
  197.  
  198.         String czy_nalezy = "";
  199.          float det = matrix.getDet();
  200.          if (det == 0) {
  201.             if (((P1_x >= P6_x) && ( P2_x<=P6_x) )||(P1_x <= P6_x) && ( P2_x>=P6_x)) {
  202.                 czy_nalezy = " TAK";
  203.             }
  204.         }else /*if ((Math.Abs(det) < 5000) && (P1_x <= P6_x && P6_x <= P2_x)) {
  205.                 czy_nalezy = "bardzo BLISKO odcinka";
  206.             }else */{
  207.             czy_nalezy = "NIE";
  208.         }
  209.         czyNalezy_label.Text = czy_nalezy;
  210.      }
  211.  
  212.      private void button1_Click_1(object sender, EventArgs e)
  213.      {
  214.          int P1_x, P1_y, P2_x, P2_y, P7_x, P7_y, P8_x, P8_y;
  215.          int.TryParse(P1x.Text, out P1_x);
  216.          int.TryParse(P1y.Text, out P1_y);
  217.          int.TryParse(P2x.Text, out P2_x);
  218.          int.TryParse(P2y.Text, out P2_y);
  219.          int.TryParse(P7x.Text, out P7_x);
  220.          int.TryParse(P7y.Text, out P7_y);
  221.          int.TryParse(P8x.Text, out P8_x);
  222.          int.TryParse(P8y.Text, out P8_y);
  223.  
  224.          g.DrawLine(pen_gray, P1_x + pictureBox1.Width / 2, -P1_y + pictureBox1.Height / 2, P2_x + pictureBox1.Width / 2, -(P2_y) + pictureBox1.Height / 2);
  225.          g.DrawLine(pen_gray, P7_x + pictureBox1.Width / 2, -P7_y + pictureBox1.Height / 2, P8_x + pictureBox1.Width / 2, -(P8_y) + pictureBox1.Height / 2);
  226.          g.DrawLine(pen1, 20, pictureBox1.Height / 2, pictureBox1.Width - 20, pictureBox1.Height / 2);
  227.          g.DrawLine(pen1, pictureBox1.Width / 2, 20, pictureBox1.Width / 2, pictureBox1.Height - 20);
  228.          drawPoint(P1_x, P1_y, Color.Black);
  229.          drawPoint(P2_x, P2_y, Color.Black);
  230.          drawPoint(P7_x, P7_y, Color.Purple);
  231.          drawPoint(P8_x, P8_y, Color.Purple);
  232.          Matrix3x3 matrix1 = new Matrix3x3(P1_x, P1_y, 1, P2_x, P2_y, 1, P7_x, P7_y, 1);
  233.          Matrix3x3 matrix2= new Matrix3x3(P1_x, P1_y, 1, P2_x, P2_y, 1, P8_x, P8_y, 1);
  234.          Matrix3x3 matrix3 = new Matrix3x3(P7_x, P7_y, 1, P8_x, P8_y, 1, P1_x, P1_y, 1);
  235.          Matrix3x3 matrix4 = new Matrix3x3(P7_x, P7_y, 1, P8_x, P8_y, 1, P2_x, P2_y, 1);
  236.  
  237.         String czyPrzecinajaSie = "na linii";
  238.  
  239.         if (Math.Sign(matrix1.getDet()) != Math.Sign(matrix2.getDet())
  240.                 && Math.Sign(matrix3.getDet()) != Math.Sign(matrix4.getDet())) {
  241.             czyPrzecinajaSie = "Przecinają się";
  242.         } else {
  243.             czyPrzecinajaSie = "Nie przecinają się";
  244.         }
  245.  
  246.         czyPrzecinajaSie_label.Text = czyPrzecinajaSie;
  247.      }
  248.  
  249.      private void wew_wielokata_Click(object sender, EventArgs e)
  250.      {
  251.          int P1_x, P1_y, P2_x, P2_y, P3_x, P3_y, P4_x, P4_y, P5_x, P5_y, P6_x, P6_y, P7_x, P7_y, P8_x, P8_y, P9_x, P9_y, P10_x, P10_y;
  252.            
  253.  
  254.             int.TryParse(P1x.Text,out P1_x);
  255.             int.TryParse(P1y.Text,out P1_y);
  256.             int.TryParse(P2x.Text,out P2_x);
  257.             int.TryParse(P2y.Text,out P2_y);
  258.             int.TryParse(P3x.Text, out P3_x);
  259.             int.TryParse(P3y.Text, out P3_y);
  260.             int.TryParse(P4x.Text,out P4_x);
  261.             int.TryParse(P4y.Text,out P4_y);
  262.             int.TryParse(P5x.Text,out P5_x);
  263.             int.TryParse(P5y.Text,out P5_y);
  264.             int.TryParse(P6x.Text,out P6_x);
  265.             int.TryParse(P6y.Text,out P6_y);
  266.             int.TryParse(P7x.Text,out P7_x);
  267.             int.TryParse(P7y.Text,out P7_y);
  268.             int.TryParse(P8x.Text,out P8_x);
  269.             int.TryParse(P8y.Text,out P8_y);
  270.             int.TryParse(P7x.Text, out P7_x);
  271.             int.TryParse(P7y.Text, out P7_y);
  272.             int.TryParse(P8x.Text, out P8_x);
  273.             int.TryParse(P8y.Text, out P8_y);
  274.             int.TryParse(P9x.Text, out P9_x);
  275.             int.TryParse(P9y.Text, out P9_y);
  276.             int.TryParse(P10x.Text, out P10_x);
  277.             int.TryParse(P10y.Text, out P10_y);
  278.             drawPoint(P1_x, P1_y, Color.Black);
  279.             drawPoint(P2_x, P2_y,Color.Black);
  280.             drawPoint(P3_x, P3_y,Color.Red);
  281.             drawPoint(P4_x, P4_y,Color.Green);
  282.             drawPoint(P5_x, P5_y ,Color.Green);
  283.             drawPoint(P6_x, P6_y,Color.Blue);
  284.             drawPoint(P7_x, P7_y,Color.Purple);
  285.             drawPoint(P8_x, P8_y, Color.Purple);
  286.             drawPoint(P9_x, P9_y,Color.Brown);
  287.             drawPoint(P10_x, P10_y, Color.Brown);
  288.             g.DrawLine(pen_gray, P1_x + pictureBox1.Width / 2, -P1_y + pictureBox1.Height / 2, P2_x + pictureBox1.Width / 2, -(P2_y) + pictureBox1.Height / 2);
  289.             g.DrawLine(pen_gray, P2_x + pictureBox1.Width / 2, -P2_y + pictureBox1.Height / 2, P3_x + pictureBox1.Width / 2, -(P3_y) + pictureBox1.Height / 2);
  290.             g.DrawLine(pen_gray, P3_x + pictureBox1.Width / 2, -P3_y + pictureBox1.Height / 2, P4_x + pictureBox1.Width / 2, -(P4_y) + pictureBox1.Height / 2);
  291.             g.DrawLine(pen_gray, P4_x + pictureBox1.Width / 2, -P4_y + pictureBox1.Height / 2, P5_x + pictureBox1.Width / 2, -(P5_y) + pictureBox1.Height / 2);
  292.             g.DrawLine(pen_gray, P5_x + pictureBox1.Width / 2, -P5_y + pictureBox1.Height / 2, P6_x + pictureBox1.Width / 2, -(P6_y) + pictureBox1.Height / 2);
  293.             g.DrawLine(pen_gray, P6_x + pictureBox1.Width / 2, -P6_y + pictureBox1.Height / 2, P7_x + pictureBox1.Width / 2, -(P7_y) + pictureBox1.Height / 2);
  294.             g.DrawLine(pen_gray, P7_x + pictureBox1.Width / 2, -P7_y + pictureBox1.Height / 2, P8_x + pictureBox1.Width / 2, -(P8_y) + pictureBox1.Height / 2);
  295.             g.DrawLine(pen_gray, P8_x + pictureBox1.Width / 2, -P8_y + pictureBox1.Height / 2, P1_x + pictureBox1.Width / 2, -(P1_y) + pictureBox1.Height / 2);
  296.             g.DrawLine(pen_green, P9_x + pictureBox1.Width / 2, -P9_y + pictureBox1.Height / 2, P10_x + pictureBox1.Width / 2, -(P10_y) + pictureBox1.Height / 2);
  297.             g.DrawLine(pen1, 20, pictureBox1.Height / 2, pictureBox1.Width - 20, pictureBox1.Height / 2);
  298.             g.DrawLine(pen1, pictureBox1.Width / 2, 20, pictureBox1.Width / 2, pictureBox1.Height - 20);
  299.          int licznik=0;
  300.          if (ifCross(P9_x, P9_y, P10_x, P10_y, P1_x, P1_y, P2_x, P2_y)) licznik++;
  301.          if (ifCross(P9_x, P9_y, P10_x, P10_y, P2_x, P2_y, P3_x, P3_y)) licznik++;
  302.          if (ifCross(P9_x, P9_y, P10_x, P10_y, P3_x, P3_y, P4_x, P4_y)) licznik++;
  303.          if (ifCross(P9_x, P9_y, P10_x, P10_y, P4_x, P4_y, P5_x, P5_y)) licznik++;
  304.          if (ifCross(P9_x, P9_y, P10_x, P10_y, P5_x, P5_y, P6_x, P6_y)) licznik++;
  305.          if (ifCross(P9_x, P9_y, P10_x, P10_y, P6_x, P6_y, P7_x, P7_y)) licznik++;
  306.          if (ifCross(P9_x, P9_y, P10_x, P10_y, P7_x, P7_y, P8_x, P8_y)) licznik++;
  307.          if (ifCross(P9_x, P9_y, P10_x, P10_y, P8_x, P8_y, P1_x, P1_y)) licznik++;
  308.  
  309.          if(licznik%2==0)
  310.              czyWewnatrz_label.Text = "Nie! Liczba przecięć: "+licznik;
  311.              else
  312.              czyWewnatrz_label.Text = "Tak! Liczba przecięć: "+licznik;
  313.  
  314.  
  315.      }
  316.      public bool ifCross(int p1x, int p1y, int p2x, int p2y, int p3x, int p3y, int p4x, int p4y)
  317.      {
  318.          Matrix3x3 matrix1 = new Matrix3x3(p1x, p1y, 1, p2x, p2y, 1, p3x, p3y, 1);
  319.          Matrix3x3 matrix2 = new Matrix3x3(p1x, p1y, 1, p2x, p2y, 1, p4x, p4y, 1);
  320.          Matrix3x3 matrix3 = new Matrix3x3(p3x, p3y, 1, p4x, p4y, 1, p1x, p1y, 1);
  321.          Matrix3x3 matrix4 = new Matrix3x3(p3x, p3y, 1, p4x, p4y, 1, p2x, p2y, 1);
  322.          
  323.  
  324.          if (Math.Sign(matrix1.getDet()) != Math.Sign(matrix2.getDet())
  325.                  && Math.Sign(matrix3.getDet()) != Math.Sign(matrix4.getDet()))
  326.          {
  327.              return true;
  328.          }
  329.          else
  330.          {
  331.              return false;
  332.          }
  333.      }
  334.  
  335.      private void przywroc_Click(object sender, EventArgs e)
  336.      {
  337.          P1x.Text = "-150";
  338.          P1y.Text = "100";
  339.          P2x.Text = "30";
  340.          P2y.Text = "70";
  341.          P3x.Text = "150";
  342.          P3y.Text = "170";
  343.          P4x.Text = "185";
  344.          P4y.Text = "80";
  345.          P5x.Text = "70";
  346.          P5y.Text = "-20";
  347.          P6x.Text = "160";
  348.          P6y.Text = "-80";
  349.          P7x.Text = "-60";
  350.          P7y.Text = "-80";
  351.          P8x.Text = "-50";
  352.          P8y.Text = "60";
  353.          P9x.Text = "-30";
  354.          P9y.Text = "-30";
  355.          P10x.Text = "-100";
  356.          P10y.Text = "180";
  357.      }
  358.  
  359.      private void pictureBox1_Click(object sender, EventArgs e)
  360.      {
  361.          MouseEventArgs me = (MouseEventArgs)e;
  362.          MouseButtons buttons = me.Button;
  363.          Point p = me.Location;
  364.  
  365.          
  366.          //if (ModifierKeys.HasFlag(Keys.Control)){
  367.          if (buttons == MouseButtons.Left && paintPicture==ktora_strona)
  368.          {
  369.              P3x.Text = Convert.ToString(p.X-pictureBox1.Width/2);
  370.              P3y.Text = Convert.ToString(-(p.Y-pictureBox1.Height/2));
  371.          }
  372.          else if (paintPicture == czy_dwa_punkty)
  373.          {    
  374.              if(buttons == MouseButtons.Left ){
  375.                  P4x.Text = Convert.ToString(p.X - pictureBox1.Width / 2);
  376.                  P4y.Text = Convert.ToString(-(p.Y - pictureBox1.Height / 2));
  377.              }
  378.              if (buttons == MouseButtons.Right)
  379.              {
  380.                  P5x.Text = Convert.ToString(p.X - pictureBox1.Width / 2);
  381.                  P5y.Text = Convert.ToString(-(p.Y - pictureBox1.Height / 2));
  382.              }
  383.  
  384.          }
  385.          pictureBox1.Refresh();
  386.              paintPicture();
  387.      }
  388.        
  389.      private void pictureBox1_MouseMove(object sender, MouseEventArgs e)
  390.      {
  391.          
  392.          pictureBox1_Click(sender, e);
  393.      }
  394.         private void generic_TextChanged(object sender, EventArgs e)
  395.         {
  396.             paintPicture();
  397.         }
  398.  
  399.  
  400. }
  401.     public class Matrix3x3
  402.     {
  403.         float[,] points;
  404.  
  405.         public Matrix3x3(float p0, float p1, float p2, float p3, float p4,
  406.                 float p5, float p6, float p7, float p8)
  407.         {
  408.             points = new float[3, 3];
  409.  
  410.             points[0, 0] = p0;
  411.             points[0, 1] = p1;
  412.             points[0, 2] = p2;
  413.  
  414.             points[1, 0] = p3;
  415.             points[1, 1] = p4;
  416.             points[1, 2] = p5;
  417.  
  418.             points[2, 0] = p6;
  419.             points[2, 1] = p7;
  420.             points[2, 2] = p8;
  421.         }
  422.  
  423.         public float getDet()
  424.         {
  425.             float result = (points[0, 0] * points[1, 1] * points[2, 2]
  426.                     + points[1, 0] * points[2, 1] * points[0, 2] + points[2, 0] * points[0, 1] * points[1, 2])
  427.                     - (points[0, 2] * points[1, 1] * points[2, 0] + points[1, 2] * points[2, 1] * points[0, 0] + points[2, 2] * points[0, 1] * points[1, 0]);
  428.             return result;
  429.         }
  430.         public void setMatrix(float p0, float p1, float p2, float p3, float p4,
  431.             float p5, float p6, float p7, float p8)
  432.         {
  433.             points = new float[3, 3];
  434.  
  435.             points[0, 0] = p0;
  436.             points[0, 1] = p1;
  437.             points[0, 2] = p2;
  438.  
  439.             points[1, 0] = p3;
  440.             points[1, 1] = p4;
  441.             points[1, 2] = p5;
  442.  
  443.             points[2, 0] = p6;
  444.             points[2, 1] = p7;
  445.             points[2, 2] = p8;
  446.         }
  447.  
  448.     };
  449.  
  450.        
  451.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement