Click here to Skip to main content
11,478,619 members (63,977 online)
Click here to Skip to main content

Sharp3D.Math - A 3D math library for .NET

, 9 Jun 2004 168K 4.5K 74
Rate this:
Please Sign up or sign in to vote.
A 3D math library written in C#

Introduction

I started building this library as part of a C# 3D engine I am currently working on. Having noticed that there isn't any decent open-source C# library for dealing with complex math out there I decided to focus my efforts on this library and release it to the world.

More information could be found on the project's workspace at http://workspaces.gotdotnet.com/sharp3d.

Features

  • Support both single-precision and double-precision floating point types.
  • Full-featured implementation of mathematical data types including complex numbers' quaternion and various sizes of matrices and vectors.
  • Geometric data types and algorithms for 2D and 3D - distance and intersection methods, bounding volumes etc.
  • Random number and noise generation.
  • Strong-Typed collections for the library's data types.
  • Extension of standard mathematical functions, such as Cos(), Sqrt(), and Exp(), to work with vectors, matrices, and complex number classes.
  • A support library for converting between DirectX and Sharp3D.Math structures.

History

  • v1.1.1621.25560 - Update
    • Added array lists for vector structures.
    • Added a Polygon class to the Geometry3D and Geometry2D namespaces.
    • Added a Triangle structure to the Geometry3D namespace.
    • Intersection Methods : Ray to plane, AABB, OBB, Triangle and Sphere (not fully implemented yet).
    • Intersection Methods between AABB, OBB and Sphere (not fully implemented yet).
    • Added <, > , <=, >= operators to the vector structures.
    • Added IIntegrator implementations : SimpsonIntegral.
    • Implemented the Parse method for vectors and complex numbers.
    • Created Sharp3D.Math.Tests library and moved all unit testing classes there so that Sharp3D.Math is no longer dependent on NUnit.Framework.dll.
  • v1.1 - First release.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

Share

About the Author

Eran Kampf
Web Developer
Israel Israel
No Biography provided

Comments and Discussions

 
Generala very useful lib.... Pin
zhaochunyan21-Apr-09 22:47
memberzhaochunyan21-Apr-09 22:47 
GeneralMatrix indexing for 3- and 4-dimensional matrixes is wrong Pin
Kluyg18-Nov-07 5:55
memberKluyg18-Nov-07 5:55 
Generalsquare root of a complex number incorrect Pin
Chris J Saunders4-Jan-07 21:35
memberChris J Saunders4-Jan-07 21:35 
Your algorithm for public static ComplexD Sqrt(ComplexD a) is incorrect.
I checked results against both MATLAB and a C library called MPC which uses GMP and MPFR as base libraries. I program in Eiffel mostly and rewrote your function in that language as I needed something similar. I have a reasonable understanding of C# and don't think I made any errors in my adaptation.

I did a search and found an article in Wikipedia which I used to make corrections. My changes caused my function to agree with MPFR and MATLAB.

Hope this helps. I have not examined other functions in your library but you may need to do some checks.

Hope this is helpful.

Regards
Chris Saunders
evas@mountaincable.net
GeneralRe: square root of a complex number incorrect Pin
Eric Engler13-Apr-07 11:03
memberEric Engler13-Apr-07 11:03 
GeneralRe: square root of a complex number incorrect Pin
Chris J Saunders13-Apr-07 15:04
memberChris J Saunders13-Apr-07 15:04 
GeneralThis saved me hours of programming Pin
vanRCAD17-Sep-06 1:30
membervanRCAD17-Sep-06 1:30 
QuestionHow to Install & Use the Library Pin
Daniel P25-May-06 18:04
memberDaniel P25-May-06 18:04 
AnswerRe: How to Install & Use the Library Pin
Eran Kampf25-May-06 23:31
memberEran Kampf25-May-06 23:31 
GeneralLibrary updates Pin
Eran Kampf10-Jan-05 7:44
memberEran Kampf10-Jan-05 7:44 
GeneralRandom number generation. Pin
wout de zeeuw25-Sep-04 10:05
memberwout de zeeuw25-Sep-04 10:05 
GeneralRe: Random number generation. Pin
Eran Kampf25-Sep-04 11:00
memberEran Kampf25-Sep-04 11:00 
QuestionWhy no credit to the Exocortex libraries this is derived from? Pin
Ben Houston19-Sep-04 12:56
memberBen Houston19-Sep-04 12:56 
AnswerRe: Why no credit to the Exocortex libraries this is derived from? Pin
Eran Kampf20-Sep-04 1:15
memberEran Kampf20-Sep-04 1:15 
GeneralRe: Why no credit to the Exocortex libraries this is derived from? Pin
Ben Houston20-Sep-04 6:01
memberBen Houston20-Sep-04 6:01 
GeneralRe: Why no credit to the Exocortex libraries this is derived from? Pin
Eran Kampf20-Sep-04 8:06
memberEran Kampf20-Sep-04 8:06 
GeneralRe: Why no credit to the Exocortex libraries this is derived from? Pin
Ben Houston20-Sep-04 8:29
memberBen Houston20-Sep-04 8:29 
GeneralRe: Why no credit to the Exocortex libraries this is derived from? Pin
Eran Kampf20-Sep-04 8:52
memberEran Kampf20-Sep-04 8:52 
GeneralRe: Why no credit to the Exocortex libraries this is derived from? Pin
Anonymous20-Sep-04 10:03
sussAnonymous20-Sep-04 10:03 
GeneralRe: Why no credit to the Exocortex libraries this is derived from? Pin
Eran Kampf20-Sep-04 10:13
memberEran Kampf20-Sep-04 10:13 
AnswerRe: Why no credit to the Exocortex libraries this is derived from? Pin
Andrew Phillips25-Aug-05 23:54
sussAndrew Phillips25-Aug-05 23:54 
GeneralGood stuff Pin
wout de zeeuw20-Aug-04 0:32
memberwout de zeeuw20-Aug-04 0:32 
GeneralNew homepage Pin
Eran Kampf15-Aug-04 8:27
memberEran Kampf15-Aug-04 8:27 
GeneralSome comments Pin
Colin Angus Mackay10-Jun-04 13:00
memberColin Angus Mackay10-Jun-04 13:00 
GeneralRe: Some comments Pin
Eran Kampf10-Jun-04 13:18
memberEran Kampf10-Jun-04 13:18 
GeneralRe: Some comments Pin
Colin Angus Mackay10-Jun-04 13:38
memberColin Angus Mackay10-Jun-04 13:38 
GeneralTrash! while still got high scores, Cheater! Pin
123ert$@yahoo.com10-Jun-04 9:36
member123ert$@yahoo.com10-Jun-04 9:36 
GeneralRe: Trash! while still got high scores, Cheater! Pin
Colin Angus Mackay10-Jun-04 10:02
memberColin Angus Mackay10-Jun-04 10:02 
GeneralRe: Trash! while still got high scores, Cheater! Pin
123ert$@yahoo.com10-Jun-04 12:08
member123ert$@yahoo.com10-Jun-04 12:08 
GeneralHuh? Pin
Eran Kampf10-Jun-04 12:26
memberEran Kampf10-Jun-04 12:26 
GeneralRe: Huh? Pin
123ert$@yahoo.com10-Jun-04 12:30
member123ert$@yahoo.com10-Jun-04 12:30 
GeneralRe: Huh? Pin
Eran Kampf10-Jun-04 12:36
memberEran Kampf10-Jun-04 12:36 
GeneralRe: Huh? Pin
123ert$@yahoo.com10-Jun-04 12:45
member123ert$@yahoo.com10-Jun-04 12:45 
GeneralRe: Huh? Pin
funkycoder10-Jan-05 5:36
memberfunkycoder10-Jan-05 5:36 
GeneralRe: Trash! while still got high scores, Cheater! Pin
Colin Angus Mackay10-Jun-04 12:51
memberColin Angus Mackay10-Jun-04 12:51 
GeneralRe: Trash! while still got high scores, Cheater! Pin
Eran Kampf10-Jun-04 13:03
memberEran Kampf10-Jun-04 13:03 
GeneralRe: Trash! while still got high scores, Cheater! Pin
123ert$@yahoo.com10-Jun-04 12:09
member123ert$@yahoo.com10-Jun-04 12:09 
GeneralRe: Trash! while still got high scores, Cheater! Pin
Coskun Oba17-Jul-04 7:54
memberCoskun Oba17-Jul-04 7:54 
GeneralRe: Trash! while still got high scores, Cheater! Pin
Herbert Sauro28-Oct-04 8:58
memberHerbert Sauro28-Oct-04 8:58 
General3D Graph (Surface) Pin
Majid Shahabfar23-May-04 6:24
memberMajid Shahabfar23-May-04 6:24 
GeneralRe: 3D Graph (Surface) Pin
ekampf23-May-04 7:47
memberekampf23-May-04 7:47 
GeneralRe: 3D Graph (Surface) Pin
Coskun Oba21-Jul-09 22:56
memberCoskun Oba21-Jul-09 22:56 
GeneralMatricies Pin
MichaelCoder20-May-04 13:17
memberMichaelCoder20-May-04 13:17 
GeneralRe: Matricies Pin
ekampf21-May-04 4:12
memberekampf21-May-04 4:12 
GeneralRe: Matricies Pin
Coskun Oba25-May-04 21:46
memberCoskun Oba25-May-04 21:46 
GeneralRe: Matricies Pin
ekampf25-May-04 23:12
memberekampf25-May-04 23:12 
QuestionDetails ? Pin
Jonathan de Halleux12-May-04 3:10
memberJonathan de Halleux12-May-04 3:10 
AnswerRe: Details ? Pin
ekampf13-May-04 22:23
memberekampf13-May-04 22:23 
GeneralRe: Details ? Pin
Jonathan de Halleux13-May-04 23:09
memberJonathan de Halleux13-May-04 23:09 
GeneralRe: Details ? Pin
Jonathan de Halleux13-May-04 23:20
memberJonathan de Halleux13-May-04 23:20 
GeneralRe: Details ? Pin
ekampf14-May-04 1:47
memberekampf14-May-04 1:47 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Terms of Use | Mobile
Web04 | 2.8.150520.1 | Last Updated 10 Jun 2004
Article Copyright 2004 by Eran Kampf
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid