My morning, summed up in two lines.
Dim dblPi As Double dblPi = Application.WorksheetFunction.Pi()
I was trying to model left ventricular activation, and I would have been much more comfortable using Matlab, but alas, I do not yet have a copy on my work computer. So for lack of a more appropriate tool, I tried it in Excel. A piece of the pressure-versus-time plot looks like a sinusoid, but the rest does not, so rather than nest some complex If() statements in one of the Excel cells, I opted to write a function in Visual Basic for Applications that describes the curve piecewise. With little true experience programming in VBA, and that which I had largely self-taught, how was I supposed to know that π was not a built-in constant? A whole block of time in the middle was flat-line when is should have been a sine, and without knowledge of how to use Microsoft's debugger I was forced to manually test each piece of the expression until I realized that Excel's Pi() did not translate directly into VBA. I still don't know what programmer would invent a language that had trig functions but no π!
1 Comments:
Excel.WorksheetFunctions.___
or something.
What do you think?
<< Home