Matrix Operations : Matrix « Windows Presentation Foundation « VB.Net

Home
VB.Net
1.2D
2.Application
3.Class
4.Data Structure
5.Data Types
6.Database ADO.net
7.Date Time
8.Development
9.Event
10.File Directory
11.Generics
12.GUI
13.Internationalization I18N
14.Language Basics
15.LINQ
16.Network Remote
17.Reflection
18.Security
19.Thread
20.Windows Presentation Foundation
21.Windows System
22.XML
23.XML LINQ
VB.Net » Windows Presentation Foundation » Matrix 




Matrix Operations
 

<Window x:Class="WpfApplication1.MatrixOperations"
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  Title="Matrix Operations" Height="250" Width="250">
  <Grid>
    <StackPanel>
      <TextBlock Margin="10,10,5,5" Text="Original Matrix:" />
      <TextBlock x:Name="tbOriginal" Margin="20,0,5,5" />
      <TextBlock Margin="10,0,5,5" Text="Inverted Matrix:" />
      <TextBlock x:Name="tbInvert" Margin="20,0,5,5" />
      <TextBlock Margin="10,0,5,5" Text="Original Matrices:" />
      <TextBlock x:Name="tbM1M2" Margin="20,0,5,5" />
      <TextBlock Margin="10,0,5,5" Text="M1 x M2:" />
      <TextBlock x:Name="tbM12" Margin="20,0,5,5" />
      <TextBlock Margin="10,0,5,5" Text="M2 x M1:" />
      <TextBlock x:Name="tbM21" Margin="20,0,5,5" />
    </StackPanel>
  </Grid>
</Window>
//File:Window.xaml.vb

Imports System
Imports System.Windows
Imports System.Windows.Media


Namespace WpfApplication1
  Public Partial Class MatrixOperations
    Inherits Window
    Public Sub New()
      Dim As New Matrix(123400)
      tbOriginal.Text = "(" & m.ToString() ")"
      m.Invert()
      tbInvert.Text = "(" & m.ToString() ")"
      Dim m1 As New Matrix(123401)
      Dim m2 As New Matrix(012101)
      Dim m12 As Matrix = Matrix.Multiply(m1, m2)
      Dim m21 As Matrix = Matrix.Multiply(m2, m1)
      tbM1M2.Text = "M1 = (" & m1.ToString() "), " " M2 = (" & m2.ToString() ")"
      tbM12.Text = "(" & m12.ToString() ")"


      tbM21.Text = "(" & m21.ToString() ")"
    End Sub
  End Class
End Namespace

   
  














Related examples in the same category
1.Matrix Transforms: Scale - Prepend
2.Matrix Transforms: ScaleMatrix Transforms: Scale
3.Matrix Transforms: Rotation atMatrix Transforms: Rotation at
4.Matrix Transforms: Skew -Prepend
5.Matrix Transforms: Skew
6.Matrix Transforms: Rotation at (x = 1, y = 2) - Prepend
7.Matrix Transforms: Rotation - Prepend
8.Matrix Transforms: Rotation
9.Matrix Transforms: Translation
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.