VBForums - Maths Forum
http://www.vbforums.com/
By popular request, a place for you to discuss Maths of all forms. Somewhere to think about algorithms and the applications of maths to programming too.enSat, 31 Jan 2015 08:33:52 GMTvBulletin60http://www.vbforums.com/images/misc/rss.pngVBForums - Maths Forum
http://www.vbforums.com/
<![CDATA[[RESOLVED] Rotating 3d Object by Axis]]>
http://www.vbforums.com/showthread.php?787077-RESOLVED-Rotating-3d-Object-by-Axis&goto=newpost
Thu, 29 Jan 2015 19:07:28 GMTI'm reworking on an old project 3d GDI+ library and I would like to rotate an object by it's x, y, and z axis'. I'm following this website's instructions on how to do the actual rotating, but I'm running into some issues. When I call my RotateOnZAxis method, it should rotate the object with a 2d feel, but instead it's stretching or shrinking the object. This is my method that I'm using:

Code:

Public Sub RotateOnZAxis(ByVal angle As System.Int32)
Dim radian As System.Double = angle * Math.PI / 180

For Each item As Point3d In _vertices
item.X = Convert.ToInt32(item.X * Math.Cos(radian) - item.Y * Math.Sin(radian))
item.Y = Convert.ToInt32(item.Y * Math.Cos(radian) - item.X * Math.Sin(radian))
Next

End Sub

It is basically my conversion of this function:

Code:

var rotateZ3D = function(theta) {
var sin_t = sin(theta);
var cos_t = cos(theta);

for (var n=0; n<nodes.length; n++) {
var node = nodes[n];
var x = node[0];
var y = node[1];
node[0] = x * cos_t - y * sin_t;
node[1] = y * cos_t + x * sin_t;
}
};

But instead of having an array of nodes I have an array of vertices where each vertex is a class with an X, Y, and Z property.

The reason I posted this in the math forum is because I believe I'm doing the math wrong; I'm fairly certain that my coding is good, just not my math :/
]]>Maths Forumdday9http://www.vbforums.com/showthread.php?787077-RESOLVED-Rotating-3d-Object-by-Axis<![CDATA[[RESOLVED] Gaussian Sigma and Pascal's Triangle]]>
http://www.vbforums.com/showthread.php?784947-RESOLVED-Gaussian-Sigma-and-Pascal-s-Triangle&goto=newpost
Sun, 04 Jan 2015 12:32:46 GMTWe all know (don't we? :)) that the numbers in given row of Pascal's triangle divided by their total give the coefficients of a 1-dimensional Gaussian kernel. How can I derive the Sigma of the corresponding Gaussian from the row number of the triangle, and vice versa?