Skip to main content
Bumped by Community user
edited body
Source Link

How to find the percentage value from A to B when I know the X value in between these two points?

I created this picture to kind of illustrate what I mean better.

enter image description here

I wrote this function which gets the percentage, but how do I also include the center offset?

private float GetPercentage(Vector2 point, float radiusOffset, float centerOffset)
{
    float radius = Math.Min(radiuscircle.rect.width / 2f, radiuscircle.rect.height / 2f);

    radius *= radiusOffset;

    return 1f - (Math.Max(Math.Abs(point.x), Math.Abs(point.y)) / radius);
}

The radius offset is from 0-1, 0 being the 0,0 position and 1 full radius. The center offset is from 1-0, 1 being the 0,0 position and 0 being the radius border.

How to find the percentage value from A to B when I know the X value in between these two points?

I created this picture to kind of illustrate what I mean better.

enter image description here

I wrote this function which gets the percentage, but how do I also include the center offset?

private float GetPercentage(Vector2 point, float radiusOffset, float centerOffset)
{
    float radius = Math.Min(radius.rect.width / 2f, radius.rect.height / 2f);

    radius *= radiusOffset;

    return 1f - (Math.Max(Math.Abs(point.x), Math.Abs(point.y)) / radius);
}

The radius offset is from 0-1, 0 being the 0,0 position and 1 full radius. The center offset is from 1-0, 1 being the 0,0 position and 0 being the radius border.

How to find the percentage value from A to B when I know the X value in between these two points?

I created this picture to kind of illustrate what I mean better.

enter image description here

I wrote this function which gets the percentage, but how do I also include the center offset?

private float GetPercentage(Vector2 point, float radiusOffset, float centerOffset)
{
    float radius = Math.Min(circle.rect.width / 2f, circle.rect.height / 2f);

    radius *= radiusOffset;

    return 1f - (Math.Max(Math.Abs(point.x), Math.Abs(point.y)) / radius);
}

The radius offset is from 0-1, 0 being the 0,0 position and 1 full radius. The center offset is from 1-0, 1 being the 0,0 position and 0 being the radius border.

added 17 characters in body
Source Link

I'm tryingHow to get afind the percentage value of x position from centerA to radius border.B when I know the X value in between these two points?

I created this picture to kind of illustrate what I mean better.

enter image description here

I wrote this function which gets the percentage, but how do I also include the center offset?

private float GetPercentage(Vector2 point, float radiusOffset, float centerOffset)
{
    float radius = Math.Min(radius.rect.width / 2f, radius.rect.height / 2f);

    radius *= radiusOffset;

    return 1f - (Math.Max(Math.Abs(point.x), Math.Abs(point.y)) / radius);
}

The radius offset is from 0-1, 0 being the 0,0 position and 1 full radius. The center offset is from 1-0, 1 being the 0,0 position and 0 being the radius border.

I'm trying to get a percentage value of x position from center to radius border.

I created this picture to kind of illustrate what I mean better.

enter image description here

I wrote this function which gets the percentage, but how do I also include the center offset?

private float GetPercentage(Vector2 point, float radiusOffset, float centerOffset)
{
    float radius = Math.Min(radius.rect.width / 2f, radius.rect.height / 2f);

    radius *= radiusOffset;

    return 1f - (Math.Max(Math.Abs(point.x), Math.Abs(point.y)) / radius);
}

The radius offset is from 0-1, 0 being the 0,0 and 1 full radius. The center offset is from 1-0, 1 being the 0,0 and 0 being the radius border.

How to find the percentage value from A to B when I know the X value in between these two points?

I created this picture to kind of illustrate what I mean better.

enter image description here

I wrote this function which gets the percentage, but how do I also include the center offset?

private float GetPercentage(Vector2 point, float radiusOffset, float centerOffset)
{
    float radius = Math.Min(radius.rect.width / 2f, radius.rect.height / 2f);

    radius *= radiusOffset;

    return 1f - (Math.Max(Math.Abs(point.x), Math.Abs(point.y)) / radius);
}

The radius offset is from 0-1, 0 being the 0,0 position and 1 full radius. The center offset is from 1-0, 1 being the 0,0 position and 0 being the radius border.

added 429 characters in body
Source Link

How to get a positionx in radius percentage value?

I'm trying to get a position in circle percentage value of x position from center to radius border.

I created this picture to kind of illustrate what I mean better.

enter image description hereenter image description here

I wrote this function which gets the percentage, but how do I also include the center offset?

private float GetPercentage(Vector2 point, float radiusOffset, float centerOffset)
{
    float radius = Math.Min(radius.rect.width / 2f, radius.rect.height / 2f);

    radius *= radiusOffset;

    return 1f - (Math.Max(Math.Abs(point.x), Math.Abs(point.y)) / radius);
}

The radius offset is from 0-1, 0 being the 0,0 and 1 full radius. The center offset is from 1-0, 1 being the 0,0 and 0 being the radius border.

How to get a position in radius percentage value?

I'm trying to get a position in circle percentage value.

I created this picture to kind of illustrate what I mean.

enter image description here

How to get x in radius percentage value?

I'm trying to get a percentage value of x position from center to radius border.

I created this picture to kind of illustrate what I mean better.

enter image description here

I wrote this function which gets the percentage, but how do I also include the center offset?

private float GetPercentage(Vector2 point, float radiusOffset, float centerOffset)
{
    float radius = Math.Min(radius.rect.width / 2f, radius.rect.height / 2f);

    radius *= radiusOffset;

    return 1f - (Math.Max(Math.Abs(point.x), Math.Abs(point.y)) / radius);
}

The radius offset is from 0-1, 0 being the 0,0 and 1 full radius. The center offset is from 1-0, 1 being the 0,0 and 0 being the radius border.

Post Undeleted by UnknownUser
Post Deleted by UnknownUser
Source Link
Loading