Muscles of the hip

In human anatomy, the muscles of the hip joint are those muscles that cause movement in the hip. Most modern anatomists define 17 of these muscles, although some additional muscles may sometimes be considered. These are often divided into four groups according to their orientation around the hip joint: the gluteal group; the lateral rotator group; the adductor group; and the iliopsoas group.
Structure.
The muscles of the hip consist of four main groups
Gluteal group.
The gluteal muscles include the gluteus maximus, gluteus medius, gluteus minimus, and tensor fasciae latae. They cover the lateral surface of the ilium. The gluteus maximus, which forms most of the muscle of the buttocks, originates primarily on the ilium and sacrum and inserts on the gluteal tuberosity of the femur as well as the iliotibial tract, a tract of strong fibrous tissue that runs along the lateral thigh to the tibia and fibula. The gluteus medius and gluteus minimus originate anterior to the gluteus maximus on the ilium and both insert on the greater trochanter of the femur. The tensor fasciae latae shares its origin with the gluteus maximus at the ilium and also shares the insertion at the iliotibial tract.
Adductor group.
The adductor brevis, adductor longus, adductor magnus, pectineus, and gracilis make up the adductor group. The adductors all originate on the pubis and insert on the medial, posterior surface of the femur, with the exception of the gracilis which inserts just below the medial condyle of the tibia.
Iliopsoas group.
The iliacus and psoas major comprise the iliopsoas group. The psoas major is a large muscle that runs from the bodies and disc of the L1 to L5 vertebrae, joins with the iliacus via its tendon, and connects to the lesser trochanter of the femur. The iliacus originates on the iliac fossa of the ilium. Together these muscles are commonly referred to as the "iliopsoas".
Lateral rotator group.
This group consists of the externus and internus obturators, the piriformis, the superior and inferior gemelli, and the quadratus femoris. These six originate at or below the acetabulum of the ilium and insert on or near the greater trochanter of the femur.
Other hip muscles.
Additional muscles, such as the rectus femoris and the sartorius, can cause some movement in the hip joint. However these muscles primarily move the knee, and not generally classified as muscles of the hip.
The hamstring muscles, which originate mostly from the ischial tuberosity inserting on the tibia/fibula, have a large moment assisting with hip extension.
Function.
Movements of the hip occur because multiple muscles activate at once. Most muscles are also responsible for more than one type of movement. 
Movements of the hip are described in anatomical terminology using anatomical terms of motion. The movement that brings the thighs close to the abdomen is called "flexion". When the legs open, such as in the lotus posture of yoga, this is called "lateral rotation", with the opposite movement called "medial rotation". Hip abduction occurs when the femur moves outward to the side, as in taking the thighs apart. Hip adduction occurs when the femur moves back to the midline. Many muscles contribute to these movements:
Hip muscles also play a role in maintaining the standing posture. These muscles work in an integrated system with muscles of the shoulder, neck, core, lower leg, and supporting muscles of the spine, to provide the ability to stand with good posture. These muscles include the gluteus medius and gluteus minimus which abduct the thigh, prevent swaying of hips, stabilize pelvic region while keeping hips level, and shift an individual’s weight in order to adjust body placement to increase one's overall body stability.