# Citation of 3rd Party Code

It is common practice in programming to use code from other sources / books. However as all of our code is used for academic purposes and assignments it is important that any code used from 3rd party sources are correctly referenced. It is assumed that you will be using the ngl:: graphics library and this code is already attributed to the various authors so it may be included without citation. Using code from other people on the course is also acceptable but the original author must be attributed. If the code already contains an Open Source license such as the GPL license *** this must not be removed *** but retained in the code submitted. For example :

/// This function was originally written by Jon Macey
void foo()
{
std::cout<<"foo \n";
}
/// end of function


However other code either from Websites or books must be cited using the Harvard standard as outlined in the University guidelines. For example if the whole module came from a website and was modified put this at the top of the source file(s)

/// @brief a simple C++ example
/// Modified from :-
/// Bjarne Stroustrup (October 4, 2009). C Style and Technique FAQ [online].
/// [Accessed 2010]. Available from: "http://www2.research.att.com/~bs/bs_faq2.html".



If you are using other 3rd Party code do not remove any comments / Author tags etc. Where possible, existing code should be maintained intact, in a seperate file (or better library), and accessed via the original authors API’s rather than being pasted into your own code. If this is not possible reference the original source and explain why you have modified it and where.

If only a small section of code is used you must indicate the start and the end of the section as follows

/// The following section is from :-
/// Dan Sunday (2006). Intersections of Rays, Segments, Planes and Triangles in 3D [online]. [Accessed 2010].
/// Available from: "http://softsurfer.com/Archive/algorithm_0105/algorithm_0105.htm".
ngl::Vec3 n=ngl::calcNormal(m_v0,m_v1,m_v2);
float a = -n.dot(tvec);
float b = n.dot(dir);
float r=a/b;
/// end of Citation


We use the /// end of Citation flag to indicate the end of the 3rd party code. If multiple sources are used you must cite them in the same way

Next