vb.net抛物线 excel抛物线图表

如何用VB.net实现物理中的抛物线?【vb.net抛物线 excel抛物线图表】你要先把
VB.net
画线的函数学会了vb.net抛物线,再来编程vb.net抛物线,你可以先试试正弦函数绘图的编程 。
抛物线VB假设速度为v , 角度为θ 。
那么炮弹射出距离为2v^2sinθcosθ/g=v^2sin2θ/g 。
假设输入为TextBox1——v,TextBox2——θ,Button1——开始计算,输出为TextBox3——结果,则
'VB .NET及以后版本
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Const Gravity As Double = 9.8 '请自己改
Dim a, b, c As Double
a = Val(TextBox1.Text)
b = Val(TextBox2.Text)
c = a ^ 2 * Math.Sin(2 * b) / Gravity
TextBox3.Text = CStr(c)
End Sub
VB6:
Private Sub Button1_Click()
Const Gravity As Double = 9.8 '请自己改
Dim a, b, c As Double
a = Val(TextBox1.Text)
b = Val(TextBox2.Text)
c = a ^ 2 * sin(2 * b) / Gravity
TextBox3.Text = CStr(c)
End Sub
LZ画图吗?
vb.net绘制曲线图 。net其实还是很好绘制图形的
你可以看下 Graphics类
Dim d As New Bitmap(Me.Width, Me.Height)‘一个图片吧
Dim g As Graphics = Graphics.FromImage(d)’绘制准备在这个图片是进行
然后就是你绘制的东西了
线 就是g.DrawLine()
圆 弧度就用g.DrawArc(Pens.Black, New Rectangle(0, 0, 400, 200), 0, 360)
复杂的就是g.DrawBezier()
等如果你用的是 VS的编译上面都有详细的参数说明
Dim d As New Bitmap(Me.Width, Me.Height)
Dim g As Graphics = Graphics.FromImage(d)
g.DrawArc(Pens.Black, New Rectangle(0, 0, 200, 200), 0, 360)
g.DrawLine(Pens.Red, New Point(0, 0), New Point(200, 200))
g.DrawLines(Pens.Green, New Point() {New Point(0, 0), New Point(50, 40), New Point(50, 80), New Point(90, 70), New Point(100, 400)})
g.DrawBezier(Pens.Yellow, New Point(0, 100), New Point(0, 0), New Point(200, 0),New Point(200, 200))
g.Dispose()
Me.BackgroundImage = d
vb.net抛物线的介绍就聊到这里吧 , 感谢你花时间阅读本站内容,更多关于excel抛物线图表、vb.net抛物线的信息别忘了在本站进行查找喔 。

    推荐阅读