• Create Account

# Mizmoon

Member Since 02 Sep 2013
Offline Last Active Mar 25 2015 04:54 AM

### #5194970Problem passing a constant string into a funciton in C

Posted by on 27 November 2014 - 07:45 AM

Aaahhhhhhhh, so simple, yet so fatal. Thank you SO much, i was pulling my hair over this for hours, haha.

EDIT: My second problem is, "first" is not properly set to "p" in the newPost function. Have i somehow mixed up my pointers? The list works if i instead do this in the main function:

```int _tmain(int argc, _TCHAR* argv[])
{
post *first = NULL;

first = newPost(first, "Kalle", "Halvarsson", 185);
first = newPost(first, "Johan", "Lovgren", 180);
first = newPost(first, "Ingrid", "Brinkenberg", 165);
first = newPost(first, "Ulrika", "Gillquist", 160);
printlist(first);
return 0;
}```

It feels a bit ugly though and i would rather if the "first" pointer was set inside the function.

### #5121670Air Resistance approximation re-entry

Posted by on 06 January 2014 - 11:40 AM

Here is the basic formula for air drag:

Fd = 0.5 * Cd * Rho * Velocity^2 * A

Where:

*Fd is the drag force in newtons, applied to the opposite direction of the velocity.

*Cd is the coefficient of drag - this is determined in wind tunnel test. It is a constant which you can tweak to your preference, but there are some examples of the Cd of different primitives to be found here: http://en.wikipedia.org/wiki/File:14ilf1l.svg

*Rho is the density of air. This can be tricky since it changes with temperature, and temperature drops at higher altitudes. Air humidity also affects density. I don't know the exact equation for this, but i suggest you use a constant air humidity, and then sample data from this calculator (http://www.denysschen.com/catalogue/density.aspx) and then make a function out of these points. You might have to find samples of air temerature at different altitudes aswell, but that should not be hard.

*Velocity relative to the airflow.

*A is the reference area in square meters.

PARTNERS