<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ru">
		<id>http://www.vbex.ru/index.php?action=history&amp;feed=atom&amp;title=VB.Net_Tutorial%2F2D_Graphics%2FHexagon</id>
		<title>VB.Net Tutorial/2D Graphics/Hexagon - История изменений</title>
		<link rel="self" type="application/atom+xml" href="http://www.vbex.ru/index.php?action=history&amp;feed=atom&amp;title=VB.Net_Tutorial%2F2D_Graphics%2FHexagon"/>
		<link rel="alternate" type="text/html" href="http://www.vbex.ru/index.php?title=VB.Net_Tutorial/2D_Graphics/Hexagon&amp;action=history"/>
		<updated>2026-04-05T07:14:14Z</updated>
		<subtitle>История изменений этой страницы в вики</subtitle>
		<generator>MediaWiki 1.30.0</generator>

	<entry>
		<id>http://www.vbex.ru/index.php?title=VB.Net_Tutorial/2D_Graphics/Hexagon&amp;diff=3305&amp;oldid=prev</id>
		<title> в 16:40, 26 мая 2010</title>
		<link rel="alternate" type="text/html" href="http://www.vbex.ru/index.php?title=VB.Net_Tutorial/2D_Graphics/Hexagon&amp;diff=3305&amp;oldid=prev"/>
				<updated>2010-05-26T16:40:30Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr style=&quot;vertical-align: top;&quot; lang=&quot;ru&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Предыдущая&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Версия 16:40, 26 мая 2010&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; style=&quot;text-align: center;&quot; lang=&quot;ru&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(нет различий)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
			</entry>

	<entry>
		<id>http://www.vbex.ru/index.php?title=VB.Net_Tutorial/2D_Graphics/Hexagon&amp;diff=3306&amp;oldid=prev</id>
		<title>Admin: 1 версия</title>
		<link rel="alternate" type="text/html" href="http://www.vbex.ru/index.php?title=VB.Net_Tutorial/2D_Graphics/Hexagon&amp;diff=3306&amp;oldid=prev"/>
				<updated>2010-05-26T12:54:54Z</updated>
		
		<summary type="html">&lt;p&gt;1 версия&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Новая страница&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==Draw Hexagon==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;vbnet&amp;quot;&amp;gt;&amp;quot;Visual Basic.Net JingCai Programming 100 Examples&lt;br /&gt;
&amp;quot;Author: Yong Zhang&lt;br /&gt;
&amp;quot;Publisher: Water Publisher China&lt;br /&gt;
&amp;quot;ISBN: 750841156&lt;br /&gt;
&lt;br /&gt;
Imports System.Drawing&lt;br /&gt;
Imports System.Drawing.Drawing2D&lt;br /&gt;
Imports System.Windows.Forms&lt;br /&gt;
public class DrawHexagon&lt;br /&gt;
   public Shared Sub Main&lt;br /&gt;
        Application.Run(New Form1)&lt;br /&gt;
   End Sub&lt;br /&gt;
End class&lt;br /&gt;
&lt;br /&gt;
Public Class Form1&lt;br /&gt;
    Inherits System.Windows.Forms.Form&lt;br /&gt;
    Public Sub New()&lt;br /&gt;
        MyBase.New()&lt;br /&gt;
        InitializeComponent()&lt;br /&gt;
    End Sub&lt;br /&gt;
    Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)&lt;br /&gt;
        If disposing Then&lt;br /&gt;
            If Not (components Is Nothing) Then&lt;br /&gt;
                components.Dispose()&lt;br /&gt;
            End If&lt;br /&gt;
        End If&lt;br /&gt;
        MyBase.Dispose(disposing)&lt;br /&gt;
    End Sub&lt;br /&gt;
    Private components As System.ruponentModel.IContainer&lt;br /&gt;
    Friend WithEvents PictureBox1 As System.Windows.Forms.PictureBox&lt;br /&gt;
    Friend WithEvents Button1 As System.Windows.Forms.Button&lt;br /&gt;
    Friend WithEvents Button2 As System.Windows.Forms.Button&lt;br /&gt;
    &amp;lt;System.Diagnostics.DebuggerStepThrough()&amp;gt; Private Sub InitializeComponent()&lt;br /&gt;
        Me.PictureBox1 = New System.Windows.Forms.PictureBox&lt;br /&gt;
        Me.Button1 = New System.Windows.Forms.Button&lt;br /&gt;
        Me.Button2 = New System.Windows.Forms.Button&lt;br /&gt;
        Me.SuspendLayout()&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        &amp;quot;PictureBox1&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        Me.PictureBox1.BackColor = System.Drawing.SystemColors.Window&lt;br /&gt;
        Me.PictureBox1.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D&lt;br /&gt;
        Me.PictureBox1.Dock = System.Windows.Forms.DockStyle.Top&lt;br /&gt;
        Me.PictureBox1.Location = New System.Drawing.Point(0, 0)&lt;br /&gt;
        Me.PictureBox1.Name = &amp;quot;PictureBox1&amp;quot;&lt;br /&gt;
        Me.PictureBox1.Size = New System.Drawing.Size(504, 304)&lt;br /&gt;
        Me.PictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize&lt;br /&gt;
        Me.PictureBox1.TabIndex = 0&lt;br /&gt;
        Me.PictureBox1.TabStop = False&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        &amp;quot;Button1&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        Me.Button1.Location = New System.Drawing.Point(160, 320)&lt;br /&gt;
        Me.Button1.Name = &amp;quot;Button1&amp;quot;&lt;br /&gt;
        Me.Button1.Size = New System.Drawing.Size(80, 32)&lt;br /&gt;
        Me.Button1.TabIndex = 1&lt;br /&gt;
        Me.Button1.Text = &amp;quot;Hexagon&amp;quot;&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        &amp;quot;Button2&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        Me.Button2.Location = New System.Drawing.Point(296, 320)&lt;br /&gt;
        Me.Button2.Name = &amp;quot;Button2&amp;quot;&lt;br /&gt;
        Me.Button2.Size = New System.Drawing.Size(80, 32)&lt;br /&gt;
        Me.Button2.TabIndex = 2&lt;br /&gt;
        Me.Button2.Text = &amp;quot;Circle&amp;quot;&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        &amp;quot;Form1&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)&lt;br /&gt;
        Me.ClientSize = New System.Drawing.Size(504, 366)&lt;br /&gt;
        Me.Controls.Add(Me.Button2)&lt;br /&gt;
        Me.Controls.Add(Me.Button1)&lt;br /&gt;
        Me.Controls.Add(Me.PictureBox1)&lt;br /&gt;
        Me.ResumeLayout(False)&lt;br /&gt;
    End Sub&lt;br /&gt;
    Dim pen1 As New System.Drawing.Pen(Color.Green, 0.4)&lt;br /&gt;
    Dim g As System.Drawing.Graphics&lt;br /&gt;
    Const Max = 20&lt;br /&gt;
    Const pi = 3.1415926&lt;br /&gt;
    Dim dx(Max), dy(Max) As Double&lt;br /&gt;
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click&lt;br /&gt;
        g = PictureBox1.CreateGraphics&lt;br /&gt;
        PictureBox1.Refresh()&lt;br /&gt;
        Dim i As Integer&lt;br /&gt;
        Dim s, r As Double&lt;br /&gt;
        i = 6&lt;br /&gt;
        s = 80&lt;br /&gt;
        r = 0.34&lt;br /&gt;
        setdate(6)&lt;br /&gt;
        snow(200.0#, 180.0#, 6, i, s, r)&lt;br /&gt;
    End Sub&lt;br /&gt;
    Private Sub Sixth(ByVal x, ByVal y, ByVal n, ByVal s)&lt;br /&gt;
        Dim i, j, x1, x2, y1, y2 As Integer&lt;br /&gt;
        For i = 0 To n&lt;br /&gt;
            If i = n Then&lt;br /&gt;
                j = 1&lt;br /&gt;
            Else&lt;br /&gt;
                j = i + 1&lt;br /&gt;
            End If&lt;br /&gt;
            x1 = Int(x + dx(i) * s) - 50&lt;br /&gt;
            y1 = Int(y + dy(i) * s) - 55&lt;br /&gt;
            x2 = Int(x + dx(j) * s) - 50&lt;br /&gt;
            y2 = Int(y + dy(j) * s) - 55&lt;br /&gt;
            g.DrawLine(pen1, x1, y1, x2, y2)&lt;br /&gt;
        Next&lt;br /&gt;
    End Sub&lt;br /&gt;
    Private Sub snow(ByVal x, ByVal y, ByVal n, ByVal i, ByVal s, ByVal r)&lt;br /&gt;
        Dim t, t1 As Integer&lt;br /&gt;
        Dim xx, yy, s1 As Double&lt;br /&gt;
        If i &amp;gt; 0 Then&lt;br /&gt;
            For t = 0 To n&lt;br /&gt;
                xx = x + dx(t) * s&lt;br /&gt;
                yy = y + dy(t) * s&lt;br /&gt;
                t1 = i - 1&lt;br /&gt;
                s1 = s * r&lt;br /&gt;
                snow(xx, yy, n, t1, s1, r)&lt;br /&gt;
            Next&lt;br /&gt;
        End If&lt;br /&gt;
        Sixth(x, y, n, s)&lt;br /&gt;
    End Sub&lt;br /&gt;
    Private Sub setdate(ByVal n)&lt;br /&gt;
        Dim i As Integer&lt;br /&gt;
        Dim theta As Double&lt;br /&gt;
        dx(i) = 0.0#&lt;br /&gt;
        dy(i) = 0.0#&lt;br /&gt;
        theta = 2.0# * pi / n&lt;br /&gt;
        For i = 1 To n&lt;br /&gt;
            dx(i) = Math.Sin(i * theta)&lt;br /&gt;
            dy(i) = Math.Cos(i * theta)&lt;br /&gt;
        Next&lt;br /&gt;
    End Sub&lt;br /&gt;
    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click&lt;br /&gt;
        PictureBox1.Refresh()&lt;br /&gt;
        g = PictureBox1.CreateGraphics&lt;br /&gt;
        Dim n, i As Integer&lt;br /&gt;
        Dim r, r1, c As Single&lt;br /&gt;
        Dim p As Double = 0.8&lt;br /&gt;
        Dim f As Double = 0.2&lt;br /&gt;
        c = 40.0#&lt;br /&gt;
        n = 6&lt;br /&gt;
        r1 = 0.5 * 1000 * (1 - f) / (1 - p)&lt;br /&gt;
        r = r1 / c&lt;br /&gt;
        g.DrawEllipse(pen1, 200 - r, 150 - r, 2 * r, 2 * r)&lt;br /&gt;
        circle(200, 150, r, n + 1)&lt;br /&gt;
    End Sub&lt;br /&gt;
    Private Sub circle(ByVal x, ByVal y, ByVal r, ByVal n)&lt;br /&gt;
        Dim tcos(100), tsin(100) As Single&lt;br /&gt;
        Dim i, ns As Integer&lt;br /&gt;
        Dim theta As Double&lt;br /&gt;
        Dim f As Single = 0.3!&lt;br /&gt;
        Dim c As Double = 2&lt;br /&gt;
        ns = 10&lt;br /&gt;
        theta = 2 * pi / ns&lt;br /&gt;
        Dim n1, f1 As Single&lt;br /&gt;
        n1 = n - 1&lt;br /&gt;
        f1 = f * r&lt;br /&gt;
        If n1 &amp;gt; 1 Then&lt;br /&gt;
            For i = 1 To ns&lt;br /&gt;
                tcos(i) = c * Math.Cos(i * theta)&lt;br /&gt;
                tsin(i) = c * Math.Sin(i * theta)&lt;br /&gt;
                g.DrawEllipse(pen1, x + r * tcos(i) - f1, y + r * tsin(i) - f1, 2 * f1, 2 * f1)&lt;br /&gt;
                circle(x + r * tcos(i), y + r * tsin(i), f1, n1)&lt;br /&gt;
            Next&lt;br /&gt;
        End If&lt;br /&gt;
    End Sub&lt;br /&gt;
End Class&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Admin</name></author>	</entry>

	</feed>