As dzt is producing a library he will be able to optimally use the .NET maths functions anyway. My library just avoids some of the looping and type conversions that B4PPC has to do to keep itself weakly typed. dzt can avoid them in his library.sin and cos which are the essence of the rotation with fast math lib
Rotation of a pixel image is a lossy process. Multiple rotations can grossly distort the image (try it in Paint Shop Pro or a similar app). Ideally you should keep a master image and rotate that in a single operation for the degree of rotation that you require. If you require a further rotation then it should be the master image that you rotate - not the already rotated version that should be discarded.The one thing I noticed is if I rotate it to far it shrinks.
Sub Globals
' declare yourself some variables as Doubles
' a structure makes it easy.
Dim Type(A, B, C)Var As Double
' but an array is fine as well (a structure is actually an array with named items)
Dim Vars(3) As Double
End Sub
...
Sub Maths
' now do the maths using those Double variables
' when optimised compiled you should get a large performance boost
' over using normal untyped variables
Var.A = 1.23
Var.B = Sqrt(Var.A)
Vars(0) = Sin(Var.B) + 3
End Sub
Array typing was introduced in v4.00 together with the external libraries support (that was an important versionI am not sure why Erel introduced this feature but you can take advantage of it to get a significant maths performance boost.
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?