CAD原理实验报告

时间:2024.4.7

服装CAD原理与应用

实验报告

目录

实验报告(一)三点画圆弧----------------------(02-07)

实验报告(二)两点画圆弧----------------------(08-12)

实验报告(三)Bezier曲线的绘制----------------(13-17)

实验报告(四)Hermite曲线的绘制---------------(18-22)

实验报告(五)B样条曲线的绘制-----------------(23-27)

实验报告(一)

一、 实验题目

使用VB软件实现三点画圆弧

二、 实验目的

1.了解服装CAD中的常用曲线,灵活运用理论知识加以运用,实现操作;

2.掌握三点画圆弧的基本原理和绘制方法;

3.运用Visual Basic 6.0软件编写程序实现通过三点的控制成功绘制圆弧。

三、 实验目的

1.实验原理

已知三个点A(x1,y1),B(x2,y2)C(x3,y3)的坐标

①根据中垂线相交于圆心可以求出圆心(x,y)的坐标以及半径r

②根据圆心以及已知三点的坐标,判断出所画圆弧的起始角,终止角和中间角的正切角度值,进而求出这三个角的角度。

③比较起始角,终止角和中间角这三点的角度大小,判断出所画圆弧的方向。

2.源代码

VERSION 5.00

Begin VB.Form Form1

   Caption         =   "三点画圆弧"

   ClientHeight    =   5835

   ClientLeft      =   120

   ClientTop       =   450

   ClientWidth     =   8280

   LinkTopic       =   "Form1"

   ScaleHeight     =   5835

   ScaleWidth      =   8280

   StartUpPosition =   3  '窗口缺省

   Begin VB.CommandButton Command3

      Caption         =   "退出"

      Height          =   615

      Left            =   6000

      TabIndex        =   3

      Top             =   4800

      Width           =   1455

   End

   Begin VB.CommandButton Command2

      Caption         =   "取消"

      Height          =   615

      Left            =   3360

      TabIndex        =   2

      Top             =   4800

      Width           =   1455

   End

   Begin VB.CommandButton Command1

      Caption         =   "画弧"

      Height          =   615

      Left            =   720

      TabIndex        =   1

      Top             =   4800

      Width           =   1455

   End

   Begin VB.PictureBox Picture1

      Height          =   4335

      Left            =   360

      ScaleHeight     =   4275

      ScaleWidth      =   7515

      TabIndex        =   0

      Top             =   240

      Width           =   7575

   End

End

Attribute VB_Name = "Form1"

Attribute VB_GlobalNameSpace = False

Attribute VB_Creatable = False

Attribute VB_PredeclaredId = True

Attribute VB_Exposed = False

Private pt() As mypoint

Private Sub Form_Load()

    ReDim pt(1)

End Sub

Private Sub Picture1_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)

  Dim s As Integer

    pt(UBound(pt)).x = x

    pt(UBound(pt)).y = y

    Picture1.Circle (x, y), 15

    s = Val(UBound(pt))

    Select Case s

        Case 1

            Picture1.Print "A"

        Case 2

            Picture1.Print "B"

        Case 3

            Picture1.Print "C"

    End Select

    If UBound(pt) > 1 Then

        Picture1.Line (pt(UBound(pt) - 1).x, pt(UBound(pt) - 1).y)-(pt(UBound(pt)).x, pt(UBound(pt)).y)

    End If

    ReDim Preserve pt(UBound(pt) + 1)

End Sub

Private Sub Command1_Click()

    Dim A1, A2, B1, B2, C1, C2 As Single

    Dim X0, Y0, r, PI As Double

    Dim t1, t2, t3 As Double

    Dim t As Double

    A1 = pt(1).x ^ 2 + pt(1).y ^ 2 - pt(3).x ^ 2 - pt(3).y ^ 2

    A2 = pt(2).x ^ 2 + pt(2).y ^ 2 - pt(3).x ^ 2 - pt(3).y ^ 2

    B1 = 2 * pt(3).x - 2 * pt(1).x

    B2 = 2 * pt(3).x - 2 * pt(2).x

    C1 = 2 * pt(1).y - 2 * pt(3).y

    C2 = 2 * pt(2).y - 2 * pt(3).y

    X0 = (A1 * C2 - A2 * C1) / (B2 * C1 - B1 * C2)

    Y0 = (A1 * B2 - A2 * B1) / (B2 * C1 - B1 * C2)

    r = Sqr((pt(1).x - X0) * (pt(1).x - X0) + (pt(1).y - Y0) * (pt(1).y - Y0))

    PI = 4 * Atn(1)

    t1 = Atn((pt(1).y - Y0) / (pt(1).x - X0))

    If pt(1).x - X0 > 0 And pt(1).y - Y0 > 0 Then

        t1 = t1

        Else

        If pt(1).x - X0 < 0 And pt(1).y - Y0 > 0 Then

            t1 = t1 + PI

            Else

            If pt(1).x - X0 < 0 And pt(1).y - Y0 < 0 Then

                t1 = t1 + PI

                Else

                t1 = t1 + 2 * PI

            End If

        End If

    End If

    t2 = Atn((pt(2).y - Y0) / (pt(2).x - X0))

    If pt(2).x - X0 > 0 And pt(2).y - Y0 > 0 Then

        t2 = t2

        Else

        If pt(2).x - X0 < 0 And pt(2).y - Y0 > 0 Then

            t2 = t2 + PI

            Else

            If pt(2).x - X0 < 0 And pt(2).y - Y0 < 0 Then

                t2 = t2 + PI

                Else

                t2 = t2 + 2 * PI

            End If

        End If

    End If

    If t1 < t3 < t2 Then

        For t = t1 To t2 Step 0.001

            x = X0 + r * Cos(t)

            y = Y0 + r * Sin(t)

            Picture1.PSet (x, y)

        Next t

    ElseIf t2 < t1 < t3 Then

            t2 = t2 + 2 * PI

            For t = t1 To t2 Step 0.001

                x = X0 + r * Cos(t)

                y = Y0 + r * Sin(t)

                Picture1.PSet (x, y)

            Next t

        ElseIf t3 < t2 < t1 Then

            t2 = t2 + 2 * PI

            For t = t1 To t2 Step 0.001

                x = X0 + r * Cos(t)

                y = Y0 + r * Sin(t)

                Picture1.PSet (x, y)

            Next t

        ElseIf t1 < t2 < t3 Then

            t1 = t1 + 2 * PI

            For t = t2 To t1 Step 0.001

                x = X0 + r * Cos(t)

                y = Y0 + r * Sin(t)

                Picture1.PSet (x, y)

            Next t

        ElseIf t3 < t1 < t2 Then

            t1 = t1 + 2 * PI

            For t = t2 To t1 Step 0.001

                x = X0 + r * Cos(t)

                y = Y0 + r * Sin(t)

                Picture1.PSet (x, y)

            Next t

        ElseIf t2 < t3 < t1 Then

            For t = t2 To t1 Step 0.001

                x = X0 + r * Cos(t)

                y = Y0 + r * Sin(t)

                Picture1.PSet (x, y)

            Next t

        End If

End Sub

Private Sub Command2_Click()

    Picture1.Cls

    ReDim pt(1)

End Sub

Private Sub Command3_Click()

    End

End Sub

四 实验结果

实验报告(二)

一、 实验题目

使用VB软件实现两点画圆弧

二、 实验目的

1.了解服装CAD中的常用曲线,灵活运用理论知识加以运用,实现操作;

2.掌握使用两端点,以及其中一端点切线画圆弧的基本原理和绘制方法;

3.运用Visual Basic 6.0软件编写程序实现通过两端点,以及其中一端点切线成功绘制圆弧。

三、 实验内容

1、实验原理

已知一圆弧两端点A,B和A端点切线的方向数L

①根据向量的知识,由已知一圆弧两端点A,B和A端点切线的方向数L求出圆心的坐标和半径大小;

②计算在圆心为原点的新坐标系下初始角和终止角的正切值,进而求出对应的角度;

③判断L和半径向量的乘积,若大于0,则为逆时针方向画圆弧,小于0,则为顺时针方向画圆弧;

④根据圆的参数方程表达式,利用VB绘制圆弧。

2、源代码  

VERSION 5.00

Begin VB.Form Form1

   AutoRedraw      =   -1  'True

   Caption         =   "两点加切线画圆弧"

   ClientHeight    =   6810

   ClientLeft      =   120

   ClientTop       =   450

   ClientWidth     =   8340

   LinkTopic       =   "Form1"

   ScaleHeight     =   6810

   ScaleWidth      =   8340

   StartUpPosition =   3  '窗口缺省

   Begin VB.CommandButton Command3

      Caption         =   "退出"

      Height          =   615

      Left            =   6240

      TabIndex        =   3

      Top             =   6000

      Width           =   1575

   End

   Begin VB.CommandButton Command2

      Caption         =   "取消"

      Height          =   615

      Left            =   3360

      TabIndex        =   2

      Top             =   6000

      Width           =   1575

   End

   Begin VB.CommandButton Command1

      Caption         =   "画弧"

      Height          =   615

      Left            =   480

      TabIndex        =   1

      Top             =   6000

      Width           =   1575

   End

   Begin VB.PictureBox Picture1

      AutoRedraw      =   -1  'True

      Height          =   5175

      Left            =   360

      ScaleHeight     =   5115

      ScaleWidth      =   7515

      TabIndex        =   0

      Top             =   480

      Width           =   7575

   End

End

Attribute VB_Name = "Form1"

Attribute VB_GlobalNameSpace = False

Attribute VB_Creatable = False

Attribute VB_PredeclaredId = True

Attribute VB_Exposed = False

Private pt() As mypoint

Private Sub Form_Load()

    ReDim pt(1)

End Sub

Private Sub Picture1_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)

    Dim s As Integer

    pt(UBound(pt)).x = x

    pt(UBound(pt)).y = y

    Picture1.Circle (x, y), 1

    s = Val(UBound(pt))

    Select Case s

        Case 1

            Picture1.Print "A"

        Case 2

            Picture1.Print "B"

        Case 3

            Picture1.Print "L"      '曲线在A点处的切线矢量

            Picture1.Line (pt(1).x, pt(1).y)-(pt(3).x, pt(3).y)

    End Select

    ReDim Preserve pt(UBound(pt) + 1)

End Sub

Private Sub Command1_Click()

    Dim X0, Y0, r As Double

    Dim a1, a2, b1, b2, c1, c2 As Double

    Dim t, t1, t2, i, j, k, m, n As Double

    Dim pi As Single

    pi = 4 * Atn(1)

    a1 = 2 * pt(1).x - 2 * pt(2).x

    a2 = pt(3).x - pt(1).x

    b1 = 2 * pt(1).y - 2 * pt(2).y

    b2 = pt(3).y - pt(1).y

    c1 = pt(1).x ^ 2 - pt(2).x ^ 2 + pt(1).y ^ 2 - pt(2).y ^ 2

    c2 = (pt(1).x - pt(3).x) * pt(1).x + (pt(1).y - pt(3).y) * pt(1).y

    X0 = (b2 * c1 - b1 * c2) / (a1 * b2 - a2 * b1)

    Y0 = (a1 * c2 - a2 * c1) / (a1 * b2 - a2 * b1)

    r = Sqr((pt(1).x - X0) ^ 2 + (pt(1).y - Y0) ^ 2)

    k = (pt(3).y - pt(1).y) * (pt(1).x - X0) - (pt(3).x - pt(1).x) * (pt(1).y - Y0)

    m = pt(1).x - X0

    n = pt(1).y - Y0

    t1 = Atn(Abs(n / m))

    If m > 0 And n > 0 Then

        t1 = t1

    ElseIf m < 0 And n > 0 Then

        t1 = pi - t1

    ElseIf m < 0 And n < 0 Then

        t1 = pi + t1

    ElseIf m > 0 And n < 0 Then

        t1 = 2 * pi - t1

    End If

    i = pt(2).x - X0

    j = pt(2).y - Y0

    t2 = Atn(Abs(j / i))

    If i > 0 And j > 0 Then

        t2 = t2

    ElseIf i < 0 And j > 0 Then

        t2 = pi - t2

    ElseIf i < 0 And j < 0 Then

        t2 = pi + t2

    ElseIf i > 0 And j < 0 Then

        t2 = 2 * pi - t2

    End If

    If k > 0 Then

        If t1 < t2 Then

        For t = t1 To t2 Step 0.0001

            x = X0 + r * Cos(t)

            y = Y0 + r * Sin(t)

            Picture1.PSet (x, y)

        Next t

        Else: t2 = t2 + 2 * pi

        For t = t1 To t2 Step 0.0001

            x = X0 + r * Cos(t)

            y = Y0 + r * Sin(t)

            Picture1.PSet (x, y)

        Next t

        End If

    Else

        If t1 > t2 Then

        For t = t2 To t1 Step 0.0001

            x = X0 + r * Cos(t)

            y = Y0 + r * Sin(t)

            Picture1.PSet (x, y)

        Next t

        Else: t1 = t1 + 2 * pi

        For t = t2 To t1 Step 0.0001

            x = X0 + r * Cos(t)

            y = Y0 + r * Sin(t)

            Picture1.PSet (x, y)

        Next t

        End If

    End If

End Sub

Private Sub Command2_Click()

    Picture1.Cls

    ReDim pt(1)

End Sub

Private Sub Command3_Click()

    End

End Sub

四、 实验结果

实验报告(三)

一、 实验题目

运用VB软件绘制Bezier曲线

二、 实验目的

1、了解服装CAD中的常用曲线,通过实际操作加以深入认识;

2、了解Bezier曲线的特点,根据Bezier曲线的基本原理,推断出绘制方法并进行操作;

3、运用Visual Basic 6.0软件编写程序实现曲线的成功绘制。

三、 实验内容

1、实验原理

设空间有n+1个点P0,P1,P2,……,Pn,则称下列函数所决定的参数曲线为Bezier曲线:

在给定几个点时,可在t[0,1]区间取一系列值,相应的计算一系列的x(t),y(t),z(t)的值,由此可确定空间曲线上各点的位置,连接后即得该空间曲线。

2、源代码

VERSION 5.00

Begin VB.Form Bezier

   Caption         =   "Bezier曲线"

   ClientHeight    =   7575

   ClientLeft      =   60

   ClientTop       =   450

   ClientWidth     =   9255

   LinkTopic       =   "Form1"

   ScaleHeight     =   7575

   ScaleWidth      =   9255

   StartUpPosition =   3  '窗口缺省

   Begin VB.CommandButton Command2

      Caption         =   "取  消"

      Height          =   495

      Left            =   3840

      TabIndex        =   3

      Top             =   6600

      Width           =   1455

   End

   Begin VB.CommandButton Command3

      Caption         =   "退  出"

      Height          =   495

      Left            =   6720

      TabIndex        =   2

      Top             =   6600

      Width           =   1455

   End

   Begin VB.CommandButton Command1

      Caption         =   "画  弧"

      Height          =   495

      Left            =   1080

      TabIndex        =   1

      Top             =   6600

      Width           =   1455

   End

   Begin VB.PictureBox Picture1

      Height          =   5655

      Left            =   600

      ScaleHeight     =   5595

      ScaleWidth      =   7995

      TabIndex        =   0

      Top             =   480

      Width           =   8055

   End

End

Attribute VB_Name = "Bezier"

Attribute VB_GlobalNameSpace = False

Attribute VB_Creatable = False

Attribute VB_PredeclaredId = True

Attribute VB_Exposed = False

Private pt() As mypoint

Private Sub Form_Load()

    ReDim pt(1)

End Sub

Private Sub Picture1_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)

    Dim s As Integer

    pt(UBound(pt)).x = x

    pt(UBound(pt)).y = y

    Picture1.Circle (x, y), 15

    s = Val(UBound(pt))

    Select Case s

        Case 1

            Picture1.Print "P0"

        Case 2

            Picture1.Print "P1"

        Case 3

            Picture1.Print "P2"

        Case 4

            Picture1.Print "P3"

        Case 5

            Picture1.Print "P4"

        Case 6

            Picture1.Print "P5"

        Case 7

            Picture1.Print "P6"

        Case 8

            Picture1.Print "P7"

        Case 9

            Picture1.Print "P8"

        Case 10

            Picture1.Print "P9"

        Case 11

            Picture1.Print "P10"

    End Select

    If UBound(pt) > 1 Then

        Picture1.Line (pt(UBound(pt) - 1).x, pt(UBound(pt) - 1).y)-(pt(UBound(pt)).x, pt(UBound(pt)).y)

    End If

    ReDim Preserve pt(UBound(pt) + 1)

End Sub

Private Sub Command1_Click()

    Dim i%, t#

    Dim j, n As Integer

    Dim s, x, y As Single

    n = UBound(pt) - 1 - 1

    For j = 1 To 1000

        x = 0

        y = 0

        For i = 0 To n

            t = j / 1000

            x = x + pt(i + 1).x * B(i, n, t)

            y = y + pt(i + 1).y * B(i, n, t)

        Next i

        Picture1.PSet (x, y)

    Next j

End Sub

Private Function fact(n As Integer)

    Dim i As Integer

    Dim s As Long

    s = 1

    For i = 1 To n

        s = s * i

    Next i

    fact = s

End Function

Private Function B(i%, n%, t#) As Single

    B = (fact(n) * t ^ i * (1 - t) ^ (n - i)) / (fact(i) * fact(n - i))

End Function

Private Sub Command2_Click()

    Picture1.Cls

    ReDim pt(1)    'pt(1)为第一个点P0

End Sub

Private Sub Command3_Click()

    End

End Sub

四、 实验结果

实验报告(四)

一、 实验题目

  运用VB软件绘制三次Hermite曲线

二、 实验目的

1、了解服装CAD中的常用曲线,通过实际操作加以深入认识;

2、了解Hermite曲线的特点,根据Hermite曲线的基本原理,推断出绘制方法并进行操作;

3、运用Visual Basic 6.0软件编写程序实现Hermite曲线的成功绘制。

三、 实验内容

1、实验原理

2、源代码

VERSION 5.00

Begin VB.Form Hermite

   Caption         =   "三次Hermite曲线"

   ClientHeight    =   7575

   ClientLeft      =   60

   ClientTop       =   450

   ClientWidth     =   9255

   LinkTopic       =   "Form1"

   ScaleHeight     =   7575

   ScaleWidth      =   9255

   StartUpPosition =   3  '窗口缺省

   Begin VB.PictureBox Picture1

      Height          =   5655

      Left            =   600

      ScaleHeight     =   5595

      ScaleWidth      =   7995

      TabIndex        =   3

      Top             =   480

      Width           =   8055

   End

   Begin VB.CommandButton Command1

      Caption         =   "画  弧"

      Height          =   495

      Left            =   1200

      TabIndex        =   2

      Top             =   6600

      Width           =   1455

   End

   Begin VB.CommandButton Command3

      Caption         =   "退  出"

      Height          =   495

      Left            =   6600

      TabIndex        =   1

      Top             =   6600

      Width           =   1455

   End

   Begin VB.CommandButton Command2

      Caption         =   "取  消"

      Height          =   495

      Left            =   3960

      TabIndex        =   0

      Top             =   6600

      Width           =   1455

   End

End

Attribute VB_Name = "Hermite"

Attribute VB_GlobalNameSpace = False

Attribute VB_Creatable = False

Attribute VB_PredeclaredId = True

Attribute VB_Exposed = False

Private pt() As mypoint

Private Sub Form_Load()

    ReDim pt(1)

End Sub

Private Sub Picture1_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)

    Dim s As Integer

    pt(UBound(pt)).x = x

    pt(UBound(pt)).y = y

    Picture1.Circle (x, y), 1

    s = Val(UBound(pt))

    Select Case s

        Case 1

            Picture1.Print "P0"

        Case 2

            Picture1.Print "P1"

        Case 3

            Picture1.Print "P01"      '曲线在P0点处的切线矢量

            Picture1.Line (pt(1).x, pt(1).y)-(pt(3).x, pt(3).y)

        Case 4

            Picture1.Print "P11"      '曲线在P1点处的切线矢量

            Picture1.Line (pt(2).x, pt(2).y)-(pt(4).x, pt(4).y)

    End Select

    ReDim Preserve pt(UBound(pt) + 1)

End Sub

Private Sub Command1_Click()

    Dim Ax, Bx, Cx, Dx, Ay, By, Cy, Dy As Single

    Dim P01x!, P11y!

    Dim j%, t As Single

    P01x = 2 * (pt(3).x - pt(1).x)

    P01y = 2 * (pt(3).y - pt(1).y)

    P11x = 2 * (pt(2).x - pt(UBound(pt) - 1).x)

    P11y = 2 * (pt(2).y - pt(UBound(pt) - 1).y)

    Ax = 2 * (pt(1).x - pt(2).x) + P01x + P11x

    Ay = 2 * (pt(1).y - pt(2).y) + P01y + P11y

    Bx = 3 * (pt(2).x - pt(1).x) - 2 * P01x - P11x

    By = 3 * (pt(2).y - pt(1).y) - 2 * P01y - P11y

    Cx = P01x

    Cy = P01y

    Dx = pt(1).x

    Dy = pt(1).y

    For j = 1 To 1000

        t = j / 1000

        x = Ax * t ^ 3 + Bx * t ^ 2 + Cx * t + Dx

        y = Ay * t ^ 3 + By * t ^ 2 + Cy * t + Dy

        Picture1.PSet (x, y)

    Next j

End Sub

Private Sub Command2_Click()

    Picture1.Cls

    ReDim pt(1)    'pt(1)为第一个点P0

End Sub

Private Sub Command3_Click()

    End

End Sub

Private Sub Form_Activate()

    Picture1.Scale (0, 500)-(500, 0)

End Sub

四、 实验结果

实验报告(五)

一、   实验题目

用VB绘制三次B样条曲线

二、   实验目的

1、了解服装CAD中的常用曲线。

2、掌握B样条曲线的基本原理和方法,了解B样条曲线的特点。

3、运用Visual Basic 6.0软件编写程序实现三次B样条曲线的成功绘制

三、 实验内容

1、实验原理

B样条曲线的数学模型:

设空间有n+k+1个点,称下列函数所决定的参数曲线为第i段B样条曲线:

k=3时,称为三次B样条曲线

根据上式可得:

代入前面的式中,第i段三次B样条曲线表达式为:

=

根据给定四个点的,可在t[0,1]区间取一系列值,相应的计算一系列的x(t),y(t),z(t)的值,由此可确定空间曲线上各点的位置,连接后即得该空间曲线。

2、源代码

VERSION 5.00

Begin VB.Form Form1

   Caption         =   "三次B样条曲线"

   ClientHeight    =   6240

   ClientLeft      =   120

   ClientTop       =   450

   ClientWidth     =   9030

   LinkTopic       =   "Form1"

   ScaleHeight     =   6240

   ScaleWidth      =   9030

   StartUpPosition =   3  '窗口缺省

   Begin VB.CommandButton Command3

      Caption         =   "退出"

      Height          =   615

      Left            =   6840

      TabIndex        =   3

      Top             =   5400

      Width           =   1575

   End

   Begin VB.CommandButton Command2

      Caption         =   "取消"

      Height          =   615

      Left            =   3720

      TabIndex        =   2

      Top             =   5400

      Width           =   1575

   End

   Begin VB.CommandButton Command1

      Caption         =   "画弧"

      Height          =   615

      Left            =   600

      TabIndex        =   1

      Top             =   5400

      Width           =   1455

   End

   Begin VB.PictureBox Picture1

      Height          =   4575

      Left            =   360

      ScaleHeight     =   4515

      ScaleWidth      =   8235

      TabIndex        =   0

      Top             =   360

      Width           =   8295

   End

End

Attribute VB_Name = "Form1"

Attribute VB_GlobalNameSpace = False

Attribute VB_Creatable = False

Attribute VB_PredeclaredId = True

Attribute VB_Exposed = False

Private pt() As mypoint

Private Sub Form_Load()

    ReDim pt(1)

End Sub

Private Sub Picture1_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)

    Dim s As Integer

    pt(UBound(pt)).x = x

    pt(UBound(pt)).y = y

    Picture1.Circle (x, y), 15

    s = Val(UBound(pt))

    Select Case s

        Case 1

            Picture1.Print "P0"

        Case 2

            Picture1.Print "P1"

        Case 3

            Picture1.Print "P2"

        Case 4

            Picture1.Print "P3"

    End Select

    If UBound(pt) > 1 Then

        Picture1.Line (pt(UBound(pt) - 1).x, pt(UBound(pt) - 1).y)-(pt(UBound(pt)).x, pt(UBound(pt)).y)

    End If

    ReDim Preserve pt(UBound(pt) + 1)

End Sub

Private Sub Command1_Click()

    Dim f0, f1, f2, f3 As Double

    Dim x, y, i, n, j As Integer

    Dim t As Single

    n = UBound(pt) - 3

    For j = 1 To 1000

            t = j / 1000

            f0 = 1 / 6 * (-t ^ 3 + 3 * t ^ 2 - 3 * t + 1)

            f1 = 1 / 6 * (3 * t ^ 3 - 6 * t ^ 2 + 4)

            f2 = 1 / 6 * (-3 * t ^ 3 + 3 * t ^ 2 + 3 * t + 1)

            f3 = 1 / 6 * t ^ 3

            x = f0 * pt(1).x + f1 * pt(2).x + f2 * pt(3).x + f3 * pt(4).x

            y = f0 * pt(1).y + f1 * pt(2).y + f2 * pt(3).y + f3 * pt(4).y

        Picture1.PSet (x, y)

    Next j

End Sub

Private Sub Command2_Click()

    Picture1.Cls

    ReDim pt(1)

End Sub

Private Sub Command3_Click()

    End

End Sub

四、 实验结果

更多相关推荐:
通信原理实验报告

通信原理实验基于MATLAB仿真的BPSK的调制与解调班级姓名指导教师实验时间基于MATLAB仿真的BPSK的调制与解调一实验要求根据题目要求查阅相关资料掌握数字带通的BPSK调制解调的相关知识学习MATLAB...

通信原理实验报告

通信原理实验报告,内容附图。

通信报告通信原理实验心得体会

通信原理实验心得体会091180024代岳通信工程众所周知,《通信原理》是电子、通信、计算机、自控和信息处理等专业的重要基础课,所以我们通信工程专业的同学在本学期除了平时要上每周2次,每次2节的通信原理理论课程…

通信原理实验报告

湖北民族学院信息工程学院实验报告班级15班姓名董非凡学号k031041533成绩试验时间20xx年4月21日12节实验地点实验楼五楼课程名称通信原理实验

通信原理课程设计报告(基于Matlab)

青岛农业大学理学与信息科学学院通信原理课程报告设计题目2DPSK调制与解调系统的仿真学生专业班级电子信息工程学生姓名学号指导教师完成时间20xx年6月12日实习设计地点信息楼11220xx年6月12日2DPSK...

通信原理实验报告

实验二数字调制一实验目的1掌握绝对码相对码概念及它们之间的变换关系2掌握用键控法产生2ASK2FSK2DPSK信号的方法3掌握相对码波形与2PSK信号波形之间的关系绝对码波形与2DPSK信号波形之间的关系4了解...

西工大通信原理实验报告四

通信原理实验报告学院电子信息学院班级实验日期20xx年12月3日1掌握ASKFSKPSK调制与解调的基本原理了解实验电路的工作过程2掌握ASKFSKPSK调制信号的频谱特性四实验原理1ASK称为振幅键控用载波的...

中南大学通信原理实验报告实验二 数字调制

中南大学通信原理实验报告学生姓名学生学号学院信息科学与工程学院专业班级完成时间实验二数字调制一实验目的1掌握绝对码相对码概念及它们之间的变换关系2掌握用键控法产生2ASK2FSK2DPSK信号的方法3掌握相对码...

通信原理实验报告

现代通信原理课程设计报告设计题目题目2专业班级学号20xx101026姓名刘敬亚任课教师设计时间题目2一设计任务与要求1设计目的使用2根据设计要求查阅相关资料掌握模拟信号的调频与解调技术培养自主学习能力3熟悉调...

西工大通信原理实验报告二

西北工业大学通信实验室通信原理实验报告学院电子信息学院班级班实验日期20xx年11月26日1掌握Agilent公司MSO6012A混合信号数字示波器的使用2熟悉各种波形的参数测量和存取方法以及文件格式3了解NW...

通信原理实验报告

广西科技大学课程名称指导教师班级姓名学号成绩评定实验报告实验一数字基带信号一实验目的1了解单极性码双极性码归零码不归零码等基带信号波形特点2掌握AMIHDB3码的编码规则3掌握集中插入帧同步码时分复用信号的帧结...

电子科技大学通信原理实验实验报告3

电子科技大学通信学院最佳接收机匹配滤波器实验报告班级物联网1班学生谢一平学号20xx010906007教师任通菊最佳接收机匹配滤波器实验一实验目的1运用MATLAB软件工具仿真随机数字信号在经过高斯白噪声污染后...

通信原理实验报告(16篇)