作者dong2 (咚兔)
看板Visual_Basic
標題[VB2005] sin的傳回值錯誤,不知道哪裡錯?
時間Tue Aug 29 15:41:59 2006
Public Class Cal
Private m_x As Single
Private m_y As Single
Public Property x() As Single
Get
Return m_x
End Get
Set(ByVal Value As Single)
m_x = Value
End Set
End Property
Public Property y() As Single
Get
Return m_y
End Get
Set(ByVal Value As Single)
m_y = Value
End Set
End Property
Public Overridable Function answer() As Single
End Function
End Class
Public Class CalSub
Inherits Cal
Public Overrides Function answer() As Single
Return Math.Pow(x, 2) + y * (Math.PI / 180)
End Function
End Class
================================程式碼結束===================================
有用過Math.sin(y)
可是誤差更多
不知道哪裡出錯
有人可以幫我看看嗎?
謝謝喔><
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 220.131.220.109
→ dong2:對了~很急 明天中午沒弄出來老師說要當掉 拜託 求救orz 08/29 17:39
※ 編輯: dong2 來自: 220.131.220.109 (08/29 17:42)
推 LPH66:我說啊..你到底要算什麼沒說啊@_@ 08/29 20:46
推 fumizuki:何不用 Double 型態呢 08/29 21:15
推 dong2:呃~就是啊~我也用過Double 可是sin(y)的值都怪怪的 08/29 22:39
→ dong2:所以我用了 Math.Sin(y * 0.01745329252) <==這個= = 08/29 22:40
→ dong2:後來y代30進去就差不多了 可是還是不知道原來那樣為什麼錯|| 08/29 22:41