<!DOCTYPE html>
<html lang="en">
	<head>
		<meta charset="UTF-8">
		<title>ODE1.HC</title>
		<link rel="stylesheet" href="/style/templeos.css">
		<script src="/script/templeos.js" defer></script>
	</head>
	<body class="BG-15 FG-0 ">
		class MyMass:CMass<br>
{<br>
  F64 radius;<br>
};<br>
<br>
class MySpring:CSpring<br>
{<br>
};<br>
<br>
CMathODE *ode=NULL;<br>
<br>
U0 MyDerivative(CMathODE *ode,F64,COrder2D3 *,COrder2D3 *)<br>
{<br>
  MyMass *tmpm1,*tmpm2;<br>
<br>
  tmpm1=ode-&gt;next_mass;<br>
  while (tmpm1!=&amp;ode-&gt;next_mass) {<br>
    tmpm2=tmpm1-&gt;next;<br>
    while (tmpm2!=&amp;ode-&gt;next_mass) {<br>
      tmpm2=tmpm2-&gt;next;<br>
    }<br>
    tmpm1=tmpm1-&gt;next;<br>
  }<br>
}<br>
<br>
U0 Init()<br>
{<br>
  ode=ODENew(0,1e-4,ODEF_HAS_MASSES);<br>
  ode-&gt;derive=&amp;MyDerivative;<br>
  ode-&gt;drag_v2=0.002;<br>
  ode-&gt;drag_v3=0.00001;<br>
  ode-&gt;acceleration_limit=5e3;<br>
<br>
  QueIns(ode,Fs-&gt;last_ode);<br>
}<br>
<br>
U0 CleanUp()<br>
{<br>
  QueRem(ode);<br>
  QueDel(&amp;ode-&gt;next_mass,TRUE);<br>
  QueDel(&amp;ode-&gt;next_spring,TRUE);<br>
  ODEDel(ode);<br>
}<br>

	</body>
</html>