LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 167
Default User Defined Array Function

I would like to write a function that calculates the cross product of two 3D
vectors (that is, x1,y1,z1 and x2,y2,z2) The output of a cross product is
also a vector (that is, x3,y3,z3).

The math is simple enough, but I would like to export each variable to a
separate cell. That is, I select three linear cells in a row, type
"=CROSS(A1:A3)", hit CSE, and the value appears in each cell.

Could someone please advise on how to distribute the results to each cell?
The code to calculate x3,y3, z3 is below:

x3 = y1 * z2 - z1 * y2
y3 = z1 * x2 - x1 * z2
z3 = x1 * y2 - y1 * x2

The call line should be:

Function Cross(x1, y1, z1, x2, y2, z2) as Double

The inputs should not be set to a type since the user should be allowed to
enter either ranges or numbers.

Thanks,
Pflugs
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Passing an array in a user defined function Peter M Excel Programming 5 June 27th 08 10:45 PM
Creating a User Defined Array Function Jeff Mason Excel Programming 6 November 24th 04 07:43 PM
Array of 100X250 as return of a user defined function? Andersson Excel Programming 6 May 29th 04 07:06 AM
Find size of array passed to user-defined function Cliff[_2_] Excel Programming 2 October 21st 03 02:09 AM
Passing an Array of User-Defined Type to an Argument of a Function Tushar Mehta[_6_] Excel Programming 0 August 17th 03 06:43 PM


All times are GMT +1. The time now is 10:26 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"