Skip to content

hexpad/radar-range

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

📡 Radar Detection Range Calculator

a C++ implementation of the radar range equation, which determines a radar system's maximum detection range based on its parameters and the target's Radar Cross Section (RCS). This program uses the traditional radar equation to determine how far a radar can detect a target:

Ekran Resmi 2025-12-06 15 30 20
// Description : calculates the maximum detection range of a radar using the basic radar range equation.
// Author : hexpad

#include <iostream>
#include <cmath>

class Radar {
private:
    double wLength;       // meters
    double P;            // Watts
    double G;             // linear
    double minPw;   // Watts

public:
    Radar(double wl, double pwr, double g, double minP)
        : wLength(wl), P(pwr), G(g), minPw(minP) {}

    // Maximum detection range (simple radar equation)
    double computeMaxRange(double targetRCS) {
        return std::pow((P * pow(G,2) * pow(wLength,2) * targetRCS) /
                            (pow(4 * M_PI,3) * minPw), 0.25);
    }
};

int main() {
    double wLength, P, G, minPw, rcs;

    std::cout << "Radar wavelength (m): ";
    std::cin >> wLength;
    std::cout << "Radar transmit power (W): ";
    std::cin >> P;
    std::cout << "Antenna gain (linear): ";
    std::cin >> G;
    std::cout << "Minimum detection power (W): ";
    std::cin >> minPw;

    std::cout << "Target RCS (m^2): ";
    std::cin >> rcs;

    Radar radar(wLength, P, G, minPw);
    double maxRange = radar.computeMaxRange(rcs);

    std::cout << "\nMaximum Detection Range: " << maxRange << " meters\n";

    if (maxRange > 0)
        std::cout << "Target is detectable within this range.\n";
    else
        std::cout << "Target not detectable.\n";

    return 0;
}

Example 1

Radar wavelength (m): 0.03
Radar transmit power (W): 5000
Antenna gain (linear): 1000
Minimum detection power (W): 1e-13
Target RCS (m^2): 0.001

Maximum Detection Range: 2182.21 meters
Target is detectable within this range.

Example 2

Radar wavelength (m): 0.23
Radar transmit power (W): 2000000
Antenna gain (linear): 30000
Minimum detection power (W): 1e-15
Target RCS (m^2): 0.01

Maximum Detection Range: 832290 meters
Target is detectable within this range.

Example 3

Radar wavelength (m): 0.03
Radar transmit power (W): 100000
Antenna gain (linear): 10000
Minimum detection power (W): 1e-14
Target RCS (m^2): 0.0001

Maximum Detection Range: 14593.3 meters
Target is detectable within this range.

About

calculates the maximum detection range of a radar using the basic radar range equation.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages